P2P: Indicate WPS events from AP mode only during group formation

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.
This commit is contained in:
Jouni Malinen 2010-11-18 12:42:02 +02:00 committed by Jouni Malinen
parent d1b024c9e5
commit ca806fb540

View 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 */
}