All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alina Friedrichsen" <x-alina@gmx.net>
To: linux-wireless@vger.kernel.org, linville@tuxdriver.com,
	johannes@sipsolutions.net
Subject: [PATCH] mac80211: IBSS join rework
Date: Thu, 29 Jan 2009 13:56:20 +0100	[thread overview]
Message-ID: <20090129125620.278940@gmx.net> (raw)

I hold back this patch for around a week to avoid
confusion. This is the second step of
"mac80211: Fixed BSSID handling revisited".

With it, in the situation of a strange merge to the
same BSSID (e.g. caused by a TSF overflow) only
reset_tsf() is called.

And sta_info_flush_delayed() is only called if you
change the network manually, not on an automatic
BSSID merge.

Signed-off-by: Alina Friedrichsen <x-alina@gmx.net>
---
diff -urN wireless-testing.orig/net/mac80211/mlme.c wireless-testing/ne=
t/mac80211/mlme.c
--- wireless-testing.orig/net/mac80211/mlme.c	2009-01-27 06:12:43.00000=
0000 +0100
+++ wireless-testing/net/mac80211/mlme.c	2009-01-29 13:32:52.000000000 =
+0100
@@ -1503,13 +1503,22 @@
 				   struct ieee80211_bss *bss)
 {
 	struct ieee80211_local *local =3D sdata->local;
-	int res, rates, i, j;
+	int res =3D 0, rates, i, j;
 	struct sk_buff *skb;
 	struct ieee80211_mgmt *mgmt;
 	u8 *pos;
 	struct ieee80211_supported_band *sband;
 	union iwreq_data wrqu;
=20
+	if (local->ops->reset_tsf) {
+		/* Reset own TSF to allow time synchronization work. */
+		local->ops->reset_tsf(local_to_hw(local));
+	}
+
+	if ((ifsta->flags & IEEE80211_STA_PREV_BSSID_SET) &&
+	   memcmp(ifsta->bssid, bss->bssid, ETH_ALEN) =3D=3D 0)
+		return res;
+
 	skb =3D dev_alloc_skb(local->hw.extra_tx_headroom + 400 +
 			    sdata->u.sta.ie_proberesp_len);
 	if (!skb) {
@@ -1520,13 +1529,11 @@
=20
 	sband =3D local->hw.wiphy->bands[local->hw.conf.channel->band];
=20
-	/* Remove possible STA entries from other IBSS networks. */
-	sta_info_flush_delayed(sdata);
-
-	if (local->ops->reset_tsf) {
-		/* Reset own TSF to allow time synchronization work. */
-		local->ops->reset_tsf(local_to_hw(local));
+	if (!(ifsta->flags & IEEE80211_STA_PREV_BSSID_SET)) {
+		/* Remove possible STA entries from other IBSS networks. */
+		sta_info_flush_delayed(sdata);
 	}
+
 	memcpy(ifsta->bssid, bss->bssid, ETH_ALEN);
 	res =3D ieee80211_if_config(sdata, IEEE80211_IFCC_BSSID);
 	if (res)

--=20
Psssst! Schon vom neuen GMX MultiMessenger geh=F6rt? Der kann`s mit all=
en: http://www.gmx.net/de/go/multimessenger
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2009-01-29 12:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090129125620.278940@gmx.net \
    --to=x-alina@gmx.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.