aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorEyal Shapira <eyal@wizery.com>2012-08-13 14:49:56 +0300
committerArik Nemtsov <arik@wizery.com>2012-08-13 14:58:44 +0300
commita56f6df6f8e5dcd650893e8beb4a16a633c179d1 (patch)
tree0fec7a2fd48f3caf4f8788f4954ee4918837c1df /wpa_supplicant
parentb8302f1894435388480719008e1b52903c7ab797 (diff)
downloadexternal_wpa_supplicant_8_ti-a56f6df6f8e5dcd650893e8beb4a16a633c179d1.zip
external_wpa_supplicant_8_ti-a56f6df6f8e5dcd650893e8beb4a16a633c179d1.tar.gz
external_wpa_supplicant_8_ti-a56f6df6f8e5dcd650893e8beb4a16a633c179d1.tar.bz2
Add P2P IEs to probe requests only when in P2P (UPSTREAM)
The current code caused P2P and consquently WPS IEs to be added to any probe as the check was for non null global->p2p. global->p2p gets set whenever P2P is initialized globally and that occurs on the first interface init. Fix this by indicating wps is in use only when in active P2P discovery or connection establishement. (i.e. not P2P_IDLE - either doing search, neg or provisioning) Signed-off-by: Eyal Shapira <eyal@wizery.com>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/p2p_supplicant.c7
-rw-r--r--wpa_supplicant/p2p_supplicant.h1
-rw-r--r--wpa_supplicant/scan.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index cc83feb..d24cc34 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -4870,6 +4870,13 @@ int wpas_p2p_in_progress(struct wpa_supplicant *wpa_s)
return p2p_in_progress(wpa_s->global->p2p);
}
+int wpas_p2p_non_idle(struct wpa_supplicant *wpa_s)
+{
+ if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
+ return 0;
+
+ return p2p_non_idle(wpa_s->global->p2p);
+}
void wpas_p2p_network_removed(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid)
diff --git a/wpa_supplicant/p2p_supplicant.h b/wpa_supplicant/p2p_supplicant.h
index 24fb81e..c3f2dac 100644
--- a/wpa_supplicant/p2p_supplicant.h
+++ b/wpa_supplicant/p2p_supplicant.h
@@ -137,6 +137,7 @@ int wpas_p2p_disconnect(struct wpa_supplicant *wpa_s);
void wpas_p2p_wps_failed(struct wpa_supplicant *wpa_s,
struct wps_event_fail *fail);
int wpas_p2p_in_progress(struct wpa_supplicant *wpa_s);
+int wpas_p2p_non_idle(struct wpa_supplicant *wpa_s);
void wpas_p2p_network_removed(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid);
struct wpa_ssid * wpas_p2p_get_persistent(struct wpa_supplicant *wpa_s,
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 2b468fb..6b43968 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -66,7 +66,7 @@ static int wpas_wps_in_use(struct wpa_supplicant *wpa_s,
}
#ifdef CONFIG_P2P
- if (!wpa_s->global->p2p_disabled && wpa_s->global->p2p) {
+ if (wpas_p2p_non_idle(wpa_s)) {
wpa_s->wps->dev.p2p = 1;
if (!wps) {
wps = 1;