aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2017-05-22 21:38:58 (GMT)
committerJouni Malinen <j@w1.fi>2017-07-17 11:54:42 (GMT)
commit51143af7e7927be44ed077763e8919f2ea45f2d5 (patch)
tree4d33910dd6734a5eae9f1fd357b3d61d60f32d8e /wpa_supplicant
parent809c675029fed0cfc9ce692e98439c14fb68c42a (diff)
downloadhostap-51143af7e7927be44ed077763e8919f2ea45f2d5.zip
hostap-51143af7e7927be44ed077763e8919f2ea45f2d5.tar.gz
hostap-51143af7e7927be44ed077763e8919f2ea45f2d5.tar.bz2
wpa_cli: Fix global control interface for STA-FIRST/STA-NEXT
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@google.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/wpa_cli.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 7ec2377..10cd243 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);