From 1e0db693dfe6ae5c107713d9135a9a3d8a9b6d10 Mon Sep 17 00:00:00 2001 From: Denton Gentry Date: Wed, 30 May 2018 15:05:42 +0000 Subject: [PATCH] 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 (backported from a84962ea35e4e97f1c4a42f2eac0242cc2cbd879) (rebased patches) Signed-off-by: Jo-Philipp Wich --- .../patches/381-hostapd_cli_UNKNOWN-COMMAND.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch 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); -- 2.25.1