]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Update BSS entries in P2P group interface only if P2P IE is present
authorNeeraj Kumar Garg <neerajkg@broadcom.com>
Fri, 6 Apr 2012 11:58:22 +0000 (14:58 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 6 Apr 2012 11:58:22 +0000 (14:58 +0300)
For concurrency scenarios we should not update the scan results without
P2P IE to P2P group interfaces. This patch is to take care if a scan has
been requested on STA interface and scan results are getting updated
from sibling to P2P group interface. A P2P GO Probe Response for a
legacy STA scan would be without P2P IE. So it will wrongly update the
BSS list of P2P group interface too when results are updated from
sibling.

Since P2P group interfaces are used only for connecting to a P2P group,
it is fine to filter out all non-P2P entries from their BSS table.

Signed-off-by: Neeraj Garg <neerajkg@broadcom.com>
wpa_supplicant/bss.c

index b79510e4067ff59a9af47a8975d76669f005e105..792316d1c4b1cb64f6a15e7c0d84a3cbd23b93d3 100644 (file)
@@ -379,6 +379,18 @@ void wpa_bss_update_scan_res(struct wpa_supplicant *wpa_s,
        }
 
        p2p = wpa_scan_get_vendor_ie(res, P2P_IE_VENDOR_TYPE);
+#ifdef CONFIG_P2P
+       if (p2p == NULL &&
+           wpa_s->p2p_group_interface != NOT_P2P_GROUP_INTERFACE) {
+               /*
+                * If it's a P2P specific interface, then don't update
+                * the scan result without a P2P IE.
+                */
+               wpa_printf(MSG_DEBUG, "BSS: No P2P IE - skipping BSS " MACSTR
+                          " update for P2P interface", MAC2STR(res->bssid));
+               return;
+       }
+#endif /* CONFIG_P2P */
        if (p2p && ssid[1] == P2P_WILDCARD_SSID_LEN &&
            os_memcmp(ssid + 2, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN) == 0)
                return; /* Skip P2P listen discovery results here */