]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Consider BSS entry pending for P2P joining as a known BSS
authorSreeramya Soratkal <ssramya@codeaurora.org>
Mon, 12 Oct 2020 10:42:14 +0000 (16:12 +0530)
committerJouni Malinen <j@w1.fi>
Mon, 26 Oct 2020 20:39:42 +0000 (22:39 +0200)
Consider the BSS entry that is pending for the P2P group join operation
also as a known network along with the existing configured networks.
This prevents removal of the BSS entry that is still in the process of
P2P join operation from the BSS table when the number of entries exceed
bss_max_count.

Signed-off-by: Sreeramya Soratkal <ssramya@codeaurora.org>
wpa_supplicant/bss.c

index 127f43e5e6b3b545a989c144dbec25fd80109a18..17c5a4e9897126bbb348a750bfa19fa5d3f65d8f 100644 (file)
@@ -351,10 +351,32 @@ static int wpa_bss_is_wps_candidate(struct wpa_supplicant *wpa_s,
 }
 
 
+static bool is_p2p_pending_bss(struct wpa_supplicant *wpa_s,
+                              struct wpa_bss *bss)
+{
+#ifdef CONFIG_P2P
+       u8 addr[ETH_ALEN];
+
+       if (os_memcmp(bss->bssid, wpa_s->pending_join_iface_addr,
+                     ETH_ALEN) == 0)
+               return true;
+       if (!is_zero_ether_addr(wpa_s->pending_join_dev_addr) &&
+           p2p_parse_dev_addr((const u8 *) (bss + 1), bss->ie_len,
+                              addr) == 0 &&
+           os_memcmp(addr, wpa_s->pending_join_dev_addr, ETH_ALEN) == 0)
+               return true;
+#endif /* CONFIG_P2P */
+       return false;
+}
+
+
 static int wpa_bss_known(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
 {
        struct wpa_ssid *ssid;
 
+       if (is_p2p_pending_bss(wpa_s, bss))
+               return 1;
+
        for (ssid = wpa_s->conf->ssid; ssid; ssid = ssid->next) {
                if (ssid->ssid == NULL || ssid->ssid_len == 0)
                        continue;