WPS ER: Use PBC overlap detection

ER should follow same rules as internal Registrar in an AP for
session overlap detection.
This commit is contained in:
Jouni Malinen 2010-07-21 19:19:53 -07:00 committed by Jouni Malinen
parent 6a4477236e
commit 498cdee0c7
3 changed files with 11 additions and 2 deletions

View file

@ -763,6 +763,7 @@ static void wps_er_process_wlanevent_probe_req(struct wps_er_ap *ap,
}
wps_er_add_sta_data(ap, addr, &attr, 1);
wps_registrar_probe_req_rx(ap->er->wps->registrar, addr, msg);
}
@ -1398,6 +1399,12 @@ int wps_er_pbc(struct wps_er *er, const u8 *uuid)
if (er == NULL || er->wps == NULL)
return -1;
if (wps_registrar_pbc_overlap(er->wps->registrar, NULL, NULL)) {
wpa_printf(MSG_DEBUG, "WPS ER: PBC overlap - do not start PBC "
"mode");
return -1;
}
/*
* TODO: Should enable PBC mode only in a single AP based on which AP
* the Enrollee (uuid) is using. Now, we may end up enabling multiple

View file

@ -278,6 +278,8 @@ int wps_device_store(struct wps_registrar *reg,
struct wps_device_data *dev, const u8 *uuid);
void wps_registrar_selected_registrar_changed(struct wps_registrar *reg);
int wps_build_authorized_macs(struct wps_registrar *reg, struct wpabuf *msg);
int wps_registrar_pbc_overlap(struct wps_registrar *reg,
const u8 *addr, const u8 *uuid_e);
/* ndef.c */
struct wpabuf * ndef_parse_wifi(struct wpabuf *buf);

View file

@ -313,8 +313,8 @@ static void wps_registrar_remove_pbc_session(struct wps_registrar *reg,
}
static int wps_registrar_pbc_overlap(struct wps_registrar *reg,
const u8 *addr, const u8 *uuid_e)
int wps_registrar_pbc_overlap(struct wps_registrar *reg,
const u8 *addr, const u8 *uuid_e)
{
int count = 0;
struct wps_pbc_session *pbc;