]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Indicate WPS events from AP mode only during group formation
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 18 Nov 2010 10:42:02 +0000 (12:42 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 18 Nov 2010 10:42:02 +0000 (12:42 +0200)
The duplicated WPS event in the parent interface should only be used
during P2P group formation, i.e., when the WPS operation was actually
started using the parent interface. When authorizing a client to
connect to an already running group, the WPS command is issued on
the group interface and there is no need to duplicate the event to
the parent interface.

wpa_supplicant/ap.c

index 5c573619e402ede121876ca66da73a2cc8fdbd58..67527938383449241455ed89ff80ad07e2d8a35d 100644 (file)
@@ -214,9 +214,11 @@ static void ap_public_action_rx(void *ctx, const u8 *buf, size_t len, int freq)
 static void ap_wps_event_cb(void *ctx, enum wps_event event,
                            union wps_event_data *data)
 {
+#ifdef CONFIG_P2P
        struct wpa_supplicant *wpa_s = ctx;
 
-       if (event == WPS_EV_FAIL && wpa_s->parent && wpa_s->parent != wpa_s) {
+       if (event == WPS_EV_FAIL && wpa_s->parent && wpa_s->parent != wpa_s &&
+           wpa_s == wpa_s->global->p2p_group_formation) {
                struct wps_event_fail *fail = &data->fail;
 
                /*
@@ -228,6 +230,7 @@ static void ap_wps_event_cb(void *ctx, enum wps_event event,
                        "msg=%d config_error=%d",
                        fail->msg, fail->config_error);
        }
+#endif /* CONFIG_P2P */
 }