hostapd: adjust patches to work with git am
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 381-hostapd_cli_UNKNOWN-COMMAND.patch
index 81e6588e723a5f86f4a337673b2d88c2f536e96d..b7d2e2b6592ad47e46563d54b4ca6e170ce70b42 100644 (file)
@@ -1,6 +1,17 @@
+From: Denton Gentry <denny@geekhold.com>
+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
-@@ -743,7 +743,7 @@ static int wpa_ctrl_command_sta(struct wpa_ctrl *ctrl, const char *cmd,
+@@ -757,7 +757,7 @@ static int wpa_ctrl_command_sta(struct w
        }
  
        buf[len] = '\0';
@@ -9,5 +20,3 @@
                return -1;
        if (print)
                printf("%s", buf);
--- 
-2.11.0