aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wps_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2011-02-22 10:20:16 (GMT)
committerJouni Malinen <j@w1.fi>2011-02-22 10:20:16 (GMT)
commitb89883a4440abffcc33a23045a03632d370caa53 (patch)
tree9fc0666b16982e93795507feb984427339027b42 /wpa_supplicant/wps_supplicant.c
parent9d832bd07d801222dbdfd3d32ebf56a3e4ec887f (diff)
downloadhostap-b89883a4440abffcc33a23045a03632d370caa53.zip
hostap-b89883a4440abffcc33a23045a03632d370caa53.tar.gz
hostap-b89883a4440abffcc33a23045a03632d370caa53.tar.bz2
P2P: Notify WPS-M2D event on parent interface and handle PBC overlap
GO may use M2D to notify that PBC overlap was detected if the GO was configured to allow only a specific P2P Device to connect using PBC. We need to report the M2D message on the parent interface if a separate group interface is used. In addition, we can stop the P2P operation if PBC overlap was indicated similarly to what we are already doing in th case the overlap is detected locally.
Diffstat (limited to 'wpa_supplicant/wps_supplicant.c')
-rw-r--r--wpa_supplicant/wps_supplicant.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index d39d2cd..94a60c7 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -404,6 +404,15 @@ static int wpa_supplicant_wps_cred(void *ctx,
}
+#ifdef CONFIG_P2P
+static void wpas_wps_pbc_overlap_cb(void *eloop_ctx, void *timeout_ctx)
+{
+ struct wpa_supplicant *wpa_s = eloop_ctx;
+ wpas_p2p_notif_pbc_overlap(wpa_s);
+}
+#endif /* CONFIG_P2P */
+
+
static void wpa_supplicant_wps_event_m2d(struct wpa_supplicant *wpa_s,
struct wps_event_m2d *m2d)
{
@@ -411,6 +420,21 @@ static void wpa_supplicant_wps_event_m2d(struct wpa_supplicant *wpa_s,
"dev_password_id=%d config_error=%d",
m2d->dev_password_id, m2d->config_error);
wpas_notify_wps_event_m2d(wpa_s, m2d);
+#ifdef CONFIG_P2P
+ if (wpa_s->parent && wpa_s->parent != wpa_s) {
+ wpa_msg(wpa_s->parent, MSG_INFO, WPS_EVENT_M2D
+ "dev_password_id=%d config_error=%d",
+ m2d->dev_password_id, m2d->config_error);
+ }
+ if (m2d->config_error == WPS_CFG_MULTIPLE_PBC_DETECTED) {
+ /*
+ * Notify P2P from eloop timeout to avoid issues with the
+ * interface getting removed while processing a message.
+ */
+ eloop_register_timeout(0, 0, wpas_wps_pbc_overlap_cb, wpa_s,
+ NULL);
+ }
+#endif /* CONFIG_P2P */
}