aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services
diff options
context:
space:
mode:
authorDenton Gentry <denny@geekhold.com>2018-05-30 15:05:42 +0000
committerJo-Philipp Wich <jo@mein.io>2018-12-18 09:43:58 +0100
commit1e0db693dfe6ae5c107713d9135a9a3d8a9b6d10 (patch)
tree0c8b73ce96e4a12853fa7668cf1049e5bcf7ee7b /package/network/services
parentcc7fa7fcecbdf31828ee0fd3ce23aef144c43c9d (diff)
downloadupstream-1e0db693dfe6ae5c107713d9135a9a3d8a9b6d10.tar.gz
upstream-1e0db693dfe6ae5c107713d9135a9a3d8a9b6d10.tar.bz2
upstream-1e0db693dfe6ae5c107713d9135a9a3d8a9b6d10.zip
hostapd: make cli treat UNKNOWN COMMAND as failing
Avoid infinite loop at 100% CPU when running hostapd_cli if CONFIG_CTRL_IFACE_MIB is not defined. _newselect(4, [3], NULL, NULL, ...) recvfrom(3, "UNKNOWN COMMAND\n", 4095, 0, NULL, NULL) = 16 sendto(3, "STA-NEXT UNKNOWN COMMAND", 24, 0, NULL, 0) = 24 Signed-off-by: Denton Gentry <denny@geekhold.com> (backported from a84962ea35e4e97f1c4a42f2eac0242cc2cbd879) (rebased patches) Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'package/network/services')
-rw-r--r--package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch11
1 files changed, 11 insertions, 0 deletions
diff --git a/package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch b/package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch
new file mode 100644
index 0000000000..7bac937373
--- /dev/null
+++ b/package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch
@@ -0,0 +1,11 @@
+--- a/hostapd/hostapd_cli.c
++++ b/hostapd/hostapd_cli.c
+@@ -743,7 +743,7 @@ static int wpa_ctrl_command_sta(struct w
+ }
+
+ buf[len] = '\0';
+- if (memcmp(buf, "FAIL", 4) == 0)
++ if (memcmp(buf, "FAIL", 4) == 0 || memcmp(buf, "UNKNOWN COMMAND", 15) == 0)
+ return -1;
+ if (print)
+ printf("%s", buf);