public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: don't try to do anything on unchanged genIE
@ 2009-05-19 19:12 Johannes Berg
  2009-05-19 20:09 ` Johannes Berg
  2009-05-19 20:16 ` [PATCH v2] " Johannes Berg
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Berg @ 2009-05-19 19:12 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Jouni Malinen

When the genIE hasn't changed there's no reason to kick
the state machine since it won't be able to do anything
new -- doing this decreases the useless work we do for
reassociating because if we do kick the state machine
it will try to find a usable BSS but there might not be
one because wpa_supplicant will only change the BSSID
a little later.

In a sense this is a workaround for userspace behaviour,
but on the other hand userspace cannot really keep track
of what the kernel currently has for genIE since any
process could have changed that while wpa_supplicant
wasn't looking.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/mlme.c |    4 ++++
 net/mac80211/wext.c |    5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

--- wireless-testing.orig/net/mac80211/mlme.c	2009-05-19 21:01:09.923912895 +0200
+++ wireless-testing/net/mac80211/mlme.c	2009-05-19 21:01:37.662665272 +0200
@@ -2496,6 +2496,10 @@ int ieee80211_sta_set_extra_ie(struct ie
 {
 	struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
 
+	if (len == ifmgd->extra_ie_len &&
+	    !memcmp(ifmgd->extra_ie, ie, len))
+		return -EALREADY;
+
 	kfree(ifmgd->extra_ie);
 	if (len == 0) {
 		ifmgd->extra_ie = NULL;
--- wireless-testing.orig/net/mac80211/wext.c	2009-05-19 21:01:22.739788309 +0200
+++ wireless-testing/net/mac80211/wext.c	2009-05-19 21:01:37.665663772 +0200
@@ -37,12 +37,13 @@ static int ieee80211_ioctl_siwgenie(stru
 
 	if (sdata->vif.type == NL80211_IFTYPE_STATION) {
 		int ret = ieee80211_sta_set_extra_ie(sdata, extra, data->length);
-		if (ret)
+		if (ret && ret != -EALREADY)
 			return ret;
 		sdata->u.mgd.flags &= ~IEEE80211_STA_AUTO_BSSID_SEL;
 		sdata->u.mgd.flags &= ~IEEE80211_STA_EXT_SME;
 		sdata->u.mgd.flags &= ~IEEE80211_STA_CONTROL_PORT;
-		ieee80211_sta_req_auth(sdata);
+		if (ret != -EALREADY)
+			ieee80211_sta_req_auth(sdata);
 		return 0;
 	}
 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-19 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-19 19:12 [PATCH] mac80211: don't try to do anything on unchanged genIE Johannes Berg
2009-05-19 20:09 ` Johannes Berg
2009-05-19 20:16 ` [PATCH v2] " Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox