[PATCH] Do not share the scan results from STA interface to p2p in=

Neeraj Garg neerajkg
Mon Apr 16 21:56:59 PDT 2012

Signed-off-by: Neeraj Garg <neerajkg at broadcom.com>
 wpa_supplicant/bss.c    |   12 ------------
 wpa_supplicant/events.c |    9 ++++++++-
 2 files changed, 8 insertions(+), 13 deletions(-)
 mode change 100644 =3D> 100755 wpa_supplicant/bss.c
 mode change 100644 =3D> 100755 wpa_supplicant/events.c

diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
old mode 100644
new mode 100755
index 792316d..b79510e
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -379,18 +379,6 @@ void wpa_bss_update_scan_res(struct wpa_supplicant *wp=
 	p2p =3D wpa_scan_get_vendor_ie(res, P2P_IE_VENDOR_TYPE);
-#ifdef CONFIG_P2P
-	if (p2p =3D=3D NULL &&
-	    wpa_s->p2p_group_interface !=3D 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] =3D=3D P2P_WILDCARD_SSID_LEN &&
 	    os_memcmp(ssid + 2, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN) =3D=3D =
 		return; /* Skip P2P listen discovery results here */
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
old mode 100644
new mode 100755
index 8fdc544..6a58ed1
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1181,7 +1181,14 @@ static void wpa_supplicant_event_scan_results(struct=
 wpa_supplicant *wpa_s,
 		if (rn2 && os_strcmp(rn, rn2) =3D=3D 0) {
 			wpa_printf(MSG_DEBUG, "%s: Updating scan results from "
 				   "sibling", ifs->ifname);
-			_wpa_supplicant_event_scan_results(ifs, data);
+			if ( (ifs->global->p2p) || (ifs->p2p_group_interface !=3D NOT_P2P_GROUP=
+				/* Do not update the scan results from STA interface to p2p interfaces=
+				wpa_printf(MSG_DEBUG, "Not Updating scan results on interface %s from =
+					   "sibling %s", ifs->ifname, wpa_s->ifname);
+				continue;
+			}
+			else
+				_wpa_supplicant_event_scan_results(ifs, data);

-----Original Message-----
From: hostap-bounces at lists.shmoo.com [mailto:hostap-bounces at lists.shmoo.com=
] On Behalf Of Jouni Malinen
Sent: Friday, April 06, 2012 5:42 PM
To: hostap at lists.shmoo.com
Subject: Re: [PATCH] P2P: For concurrency scenarios we should not update th=
e scan results without P2PIE to p2p group interface

On Thu, Apr 05, 2012 at 05:43:21AM -0700, Neeraj Kumar Garg wrote:
> 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 a=
re updated from sibling. Plz let me know if patch is OK.

Thanks, applied.

This is actually doing quite a bit more than avoiding scan updates based
on requests from non-P2P STA interface, i.e., even scans requested by
the P2P group interface are not filtered to only include BSSes that
include P2P IE. That sounds fine in general taken into account that
these interfaces are used only for P2P connections. Another option would
have been to avoid sharing of the scan results in general, but this type
of filtering mechanism looks fine and can even save some memory.

This brings up a more generic question of whether scan results can
really be shared easily between virtual interfaces. For P2P, there is a
clear difference in Probe Response contents, but there could be similar
differences for some other use cases, too.. In addition, it could be
useful to be able to share a single BSS table among all virtual
interface of the same radio at some point. Obviously, that type of
optimization would need to take possible differences based on Probe
Request frame contents into account.

Jouni Malinen                                            PGP id EFC895FA
HostAP mailing list
HostAP at lists.shmoo.com

More information about the Hostap mailing list