P2P NFC: Do not try to join peer if both devices are already GO

Send a P2P-NFC-BOTH-GO event to upper layers to determine what to
do in case both devices going through NFC connection handover are
already operating as a GO.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2013-04-04 15:32:09 +03:00 committed by Jouni Malinen
parent 201b0f5fa6
commit 74df9ecd4a
4 changed files with 17 additions and 2 deletions

View file

@ -7212,6 +7212,15 @@ static int wpas_p2p_nfc_connection_handover(struct wpa_supplicant *wpa_s,
if (res)
return res;
if (params.next_step == NO_ACTION)
return 0;
if (params.next_step == BOTH_GO) {
wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_NFC_BOTH_GO "peer=" MACSTR,
MAC2STR(params.peer->p2p_device_addr));
return 0;
}
wpabuf_free(wpa_s->p2p_oob_dev_pw);
wpa_s->p2p_oob_dev_pw = NULL;
@ -7261,6 +7270,8 @@ static int wpas_p2p_nfc_connection_handover(struct wpa_supplicant *wpa_s,
switch (params.next_step) {
case NO_ACTION:
case BOTH_GO:
/* already covered above */
return 0;
case JOIN_GROUP:
return wpas_p2p_nfc_join_group(wpa_s, &params);