Patchwork P2P: For concurrency scenarios we should not update the scan results without P2PIE to p2p group interface

login
register
mail settings
Submitter Neeraj Garg
Date April 5, 2012, 12:43 p.m.
Message ID <2C2F1EBA8050E74EA81502D5740B4BD6BBDF3DD84D@SJEXCHCCR02.corp.ad.broadcom.com>
Download mbox | patch
Permalink /patch/150948/
State Accepted
Commit c772ef43f6e91e2e90d610c5f3275d45ade286f6
Headers show

Comments

Neeraj Garg - April 5, 2012, 12:43 p.m.
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. Plz let me know if patch is OK.

From 6ed3c8a7d2ef425bcc8bdaf7cea5c9fd78931810 Mon Sep 17 00:00:00 2001
From: Neeraj Garg <neerajkg@broadcom.com>
Date: Thu, 5 Apr 2012 17:40:06 +0530
Subject: [PATCH] For concurrency scenarios we should not update the scan results without P2PIE to p2p group interface
 Signed-off-by: Neeraj Garg <neerajkg@broadcom.com>

---
 wpa_supplicant/bss.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 wpa_supplicant/bss.c
Jouni Malinen - April 6, 2012, 12:11 p.m.
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 are 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.

Patch

diff --git a/wpa_supplicant/bss.c b/wpa_supplicant/bss.c
old mode 100644
new mode 100755
index b79510e..cdae799
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -379,6 +379,14 @@  void wpa_bss_update_scan_res(struct wpa_supplicant *wpa_s,
 	}
 
 	p2p = wpa_scan_get_vendor_ie(res, P2P_IE_VENDOR_TYPE);
+	if (p2p == NULL) {
+		if (wpa_s->p2p_group_interface != NOT_P2P_GROUP_INTERFACE) {
+			/* If its 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 update for p2p interface");
+			return;
+		}
+	}
 	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 */