oxnas: drop target
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 381-hostapd_cli_UNKNOWN-COMMAND.patch
1 From: Denton Gentry <denny@geekhold.com>
2 Date: Wed, 30 May 2018 15:05:42 +0000
3 Subject: [PATCH] hostapd: make cli treat UNKNOWN COMMAND as failing
4
5 Avoid infinite loop at 100% CPU when running hostapd_cli
6 if CONFIG_CTRL_IFACE_MIB is not defined.
7
8 _newselect(4, [3], NULL, NULL, ...)
9 recvfrom(3, "UNKNOWN COMMAND\n", 4095, 0, NULL, NULL) = 16
10 sendto(3, "STA-NEXT UNKNOWN COMMAND", 24, 0, NULL, 0) = 24
11
12 --- a/hostapd/hostapd_cli.c
13 +++ b/hostapd/hostapd_cli.c
14 @@ -753,7 +753,7 @@ static int wpa_ctrl_command_sta(struct w
15 }
16
17 buf[len] = '\0';
18 - if (memcmp(buf, "FAIL", 4) == 0)
19 + if (memcmp(buf, "FAIL", 4) == 0 || memcmp(buf, "UNKNOWN COMMAND", 15) == 0)
20 return -1;
21 if (print)
22 printf("%s", buf);