<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From: Denton Gentry &lt;denny@geekhold.com&gt;
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

--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -753,7 +753,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);
</pre></body></html>