aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2012-07-17 15:33:31 +0300
committerArik Nemtsov <arik@wizery.com>2012-08-02 13:04:02 +0300
commita96ab01f2149726f4212aeaaa97fe7d39424b90e (patch)
treed1eb9b567b6c49d3ee79b5922662a5d427bb68f2
parent9d98704facd4288a0f04c51ea784e9a72cfec549 (diff)
downloadexternal_wpa_supplicant_8_ti-a96ab01f2149726f4212aeaaa97fe7d39424b90e.zip
external_wpa_supplicant_8_ti-a96ab01f2149726f4212aeaaa97fe7d39424b90e.tar.gz
external_wpa_supplicant_8_ti-a96ab01f2149726f4212aeaaa97fe7d39424b90e.tar.bz2
Initialize P2P on p2p0 and not wlan0 (JB)
P2P is being initialized using a global struct which points to the first initialized interface wpa_s struct. That's causing P2P commands sent on the control socket matching p2p0 to generate scan and ROC on the wrong interface (wlan0) as well as events like PEER_DEVICE_FOUND are sent on the wrong control socket to the Android framework. This caused the framework to ignore these and prevent displaying the P2P peer in the UI. Solve it by an ugly hack for now to enable P2P only when the interface p2p0 is being initialized. This probably should be fixed upstream as well by marking somehow on which interface you can do p2p or enable p2p per interface. Signed-off-by: Eyal Shapira <eyal@wizery.com>
-rw-r--r--wpa_supplicant/wpa_supplicant.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index e36ada0..c2300dc 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2845,10 +2845,13 @@ next_driver:
}
#ifdef CONFIG_P2P
- if (wpas_p2p_init(wpa_s->global, wpa_s) < 0) {
- wpa_msg(wpa_s, MSG_ERROR, "Failed to init P2P");
- return -1;
- }
+#ifdef ANDROID
+ if (os_strncmp(iface->ifname, "p2p0", 4) == 0)
+#endif /* ANDROID */
+ if (wpas_p2p_init(wpa_s->global, wpa_s) < 0) {
+ wpa_msg(wpa_s, MSG_ERROR, "Failed to init P2P");
+ return -1;
+ }
#endif /* CONFIG_P2P */
if (wpa_bss_init(wpa_s) < 0)