]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Accept invitations to already running persistent group
authorJouni Malinen <jouni.malinen@atheros.com>
Fri, 19 Nov 2010 10:58:31 +0000 (12:58 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 19 Nov 2010 10:58:31 +0000 (12:58 +0200)
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.

wpa_supplicant/p2p_supplicant.c

index 2c1615cf4997415fb7cdd5da1c21dc5880c20090..ad9c849c476dc003c1389aeab576bb6b658f697b 100644 (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;