[PATCH] wpa_cli: Fix global control interface for STA-FIRST/STA-NEXT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From 4d721211cef87c7d284d307e82a0211352f7b462 Mon Sep 17 00:00:00 2001
From: Dmitry Shmidt <dimitrysh@xxxxxxxxxx>
Date: Mon, 22 May 2017 14:31:05 -0700
Subject: [PATCH] wpa_cli: Fix global control interface for
 STA/STA-FIRST/STA-NEXT
To: hostap@xxxxxxxxxxxxxxxxxxx

If global control interface is used and wlan doesn't support P2P,
  wpa_s->global->p2p == NULL, and log shows:
wpa_supplicant: Failed to create interface p2p-dev-wlan0: -5 (I/O error)
wpa_supplicant: nl80211: Failed to create a P2P Device interface p2p-dev-wlan0
wpa_supplicant: P2P: Failed to enable P2P Device interface

Then STA-FIRST/STA-NEXT is not going to redirect to any interface, making
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@xxxxxxxxxx>
---
 wpa_supplicant/wpa_cli.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 8278bd2f0..13af3253c 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -1823,7 +1823,8 @@ 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) ||
+	    (os_memcmp(buf, "UNKNOWN COMMAND", 15) == 0))
 		return -1;
 	if (print)
 		printf("%s", buf);
--
2.13.0.303.g4ebf302169-goog


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux