diff mbox

wpa_supplicant: Fix global control interface for STA_FIRST /

Message ID 94eb2c193506846ae70546df41f6@google.com
State Accepted
Headers show

Commit Message

Dmitry Shmidt Jan. 24, 2017, 11:12 p.m. UTC
From 775a1fa7dd51e5a4fd98599144100a1c6aff89f3 Mon Sep 17 00:00:00 2001
From: Dmitry Shmidt <dimitrysh@google.com>
Date: Tue, 24 Jan 2017 13:41:34 -0800
Subject: [PATCH] wpa_supplicant: Fix global control interface for STA_FIRST  
/
  STA-NEXT

update_stations(ctrl_conn) is stuck in never-ending loop:

sendto(3, "STA-FIRST", 9, 0, NULL, 0)   = 9
pselect6(4, [3], NULL, NULL, {10, 0}, NULL) = 1 (in [3], left {9,  
999995000})
recvfrom(3, "UNKNOWN COMMAND\n", 4095, 0, NULL, NULL) = 16
sendto(3, "STA-NEXT UNKNOWN COMMAND", 24, 0, NULL, 0) = 24
pselect6(4, [3], NULL, NULL, {10, 0}, NULL) = 1 (in [3], left {9,  
999995833})
recvfrom(3, "UNKNOWN COMMAND\n", 4095, 0, NULL, NULL) = 16
sendto(3, "STA-NEXT UNKNOWN COMMAND", 24, 0, NULL, 0) = 24
pselect6(4, [3], NULL, NULL, {10, 0}, NULL) = 1 (in [3], left {9,  
999995000})
recvfrom(3, "UNKNOWN COMMAND\n", 4095, 0, NULL, NULL) = 16
sendto(3, "STA-NEXT UNKNOWN COMMAND", 24, 0, NULL, 0) = 24

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
---
  wpa_supplicant/ctrl_iface.c | 4 ++++
  1 file changed, 4 insertions(+)

  	static const char * prefix[] = {

Comments

Jouni Malinen Jan. 29, 2017, 11:59 p.m. UTC | #1
On Tue, Jan 24, 2017 at 11:12:54PM +0000, dimitrysh@google.com wrote:
> Subject: [PATCH] wpa_supplicant: Fix global control interface for STA_FIRST
> /
>  STA-NEXT

Thanks, applied with some fixes:

> diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
> @@ -10188,6 +10188,10 @@ static char *
> wpas_global_ctrl_iface_redir_p2p(struct wpa_global *global,
>  		"P2P_CANCEL",
>  		"P2P_PRESENCE_REQ",
>  		"P2P_EXT_LISTEN",
> +#ifdef CONFIG_AP
> +		"STA-FIRST",
> +		"STA-LAST",
> +#endif

There is no STA-LAST, so I changed this to STA-NEXT and moved it to the
following array of prefixes to be able to match with the argument. In
addition, I added the STA command there since it should continue to have
similar behavior to the other STA* commands.
diff mbox

Patch

diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index aa1211c2a..ce10226d3 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -10188,6 +10188,10 @@  static char *  
wpas_global_ctrl_iface_redir_p2p(struct wpa_global *global,
  		"P2P_CANCEL",
  		"P2P_PRESENCE_REQ",
  		"P2P_EXT_LISTEN",
+#ifdef CONFIG_AP
+		"STA-FIRST",
+		"STA-LAST",
+#endif
  		NULL
  	};