P2P: Accept invitations to already running persistent group

We can automatically accept invitations that are for a persistent
group that is already running. There is no need to confirm this
separately or preparare a new group interface.
This commit is contained in:
Jouni Malinen 2010-11-19 12:58:31 +02:00 committed by Jouni Malinen
parent 9d39057c2b
commit ab72eb5256

View file

@ -1834,6 +1834,7 @@ static u8 wpas_invitation_process(void *ctx, const u8 *sa, const u8 *bssid,
struct wpa_ssid *s;
u8 cur_bssid[ETH_ALEN];
int res;
struct wpa_supplicant *grp;
if (!persistent_group) {
wpa_printf(MSG_DEBUG, "P2P: Invitation from " MACSTR
@ -1853,6 +1854,15 @@ static u8 wpas_invitation_process(void *ctx, const u8 *sa, const u8 *bssid,
return P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE;
}
grp = wpas_get_p2p_group(wpa_s, ssid, ssid_len, go);
if (grp) {
wpa_printf(MSG_DEBUG, "P2P: Accept invitation to already "
"running persistent group");
if (*go)
os_memcpy(group_bssid, grp->own_addr, ETH_ALEN);
goto accept_inv;
}
if (!wpa_s->conf->persistent_reconnect)
return P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE;