[PATCH] wpa_cli: Fix endless loop relating to STA-NEXT

greearb at candelatech.com greearb at candelatech.com
Thu Jun 8 08:25:28 PDT 2017


From: Ben Greear <greearb at candelatech.com>

Starting 'wpa_cli -g /foo' against a supplicant that did not
have AP mode support compiled in would cause an endless loop of
log messages in the supplicant, and wpa_cli would not actually work
properly.

This fix was inspired by one posted by Denton Gentry:

http://lists.infradead.org/pipermail/lede-dev/2017-April/007002.html

Signed-off-by: Ben Greear <greearb at candelatech.com>
---
 wpa_supplicant/wpa_cli.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 95e83c2..1680c54 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -1825,7 +1825,7 @@ static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd,
 	}
 
 	buf[len] = '\0';
-	if (os_memcmp(buf, "FAIL", 4) == 0)
+	if (os_memcmp(buf, "FAIL", 4) == 0 || memcmp(buf, "UNKNOWN COMMAND", 15) == 0)
 		return -1;
 	if (print)
 		printf("%s", buf);
-- 
2.7.5




More information about the Hostap mailing list