mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
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.
This commit is contained in:
parent
9d832bd07d
commit
b89883a444
@ -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 */
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user