WPS: Indicate PBC session overlap in wps_pbc return value

Use a specific return value, WPS-PBC-OVERLAP, to indicate a reason
for rejecting a wps_pbc command in wpa_supplicant AP mode if the
PBC mode cannot be started due to PBC session overlap having been
detected during monitor time.
This commit is contained in:
Chao-Wen Yang 2011-03-10 18:59:51 +02:00 committed by Jouni Malinen
parent 3cc002ff97
commit 3152ff421e
2 changed files with 16 additions and 5 deletions

View file

@ -873,11 +873,14 @@ static void wps_registrar_pbc_timeout(void *eloop_ctx, void *timeout_ctx)
* @reg: Registrar data from wps_registrar_init()
* @p2p_dev_addr: Limit allowed PBC devices to the specified P2P device, %NULL
* indicates no such filtering
* Returns: 0 on success, -1 on failure
* Returns: 0 on success, -1 on failure, -2 on session overlap
*
* This function is called on an AP when a push button is pushed to activate
* PBC mode. The PBC mode will be stopped after walk time (2 minutes) timeout
* or when a PBC registration is completed.
* or when a PBC registration is completed. If more than one Enrollee in active
* PBC mode has been detected during the monitor time (previous 2 minutes), the
* PBC mode is not actived and -2 is returned to indicate session overlap. This
* is skipped if a specific Enrollee is selected.
*/
int wps_registrar_button_pushed(struct wps_registrar *reg,
const u8 *p2p_dev_addr)
@ -887,7 +890,7 @@ int wps_registrar_button_pushed(struct wps_registrar *reg,
wpa_printf(MSG_DEBUG, "WPS: PBC overlap - do not start PBC "
"mode");
wps_pbc_overlap_event(reg->wps);
return -1;
return -2;
}
wpa_printf(MSG_DEBUG, "WPS: Button pushed - PBC mode started");
reg->force_pbc_overlap = 0;