Search Linux Wireless

[RFC] mac80211: ieee80211_ibss_add_sta called uneccessarily

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

while creating a patch for IEEE802.11n with IBSS, i found that 
ieee80211_ibss_add_sta is called way to often by prepare_for_handlers in 
net/mac80211/rx.c.

In net/mac80211/rx.c we check if the IBSSs match with ieee80211_bssid_match(). 
If they dont and we are not scanning, we are leaving.
But ieee80211_bssid_match() will also return true if our BSSID is set to 
broadcast. And the interface is set to broadcast if we are scanning witch 
happens if we created an IBSS and are still "alone". So we will never return.

So i would change !ieee80211_bssid_match just into compare_ether_addr.

Well, this only affects CPU (and my printk output) as ieee80211_ibss_add_sta 
checks the BSSIDs on its own again, but we safe some needless function calls.

Hope i could give a understandable explanation of my patch

Signed-off-by: Alexander Simon <alexander.simon@xxxxxxxxx>
diff -Nrup compat-wireless-2011-01-17.orig/net/mac80211/rx.c compat-wireless-2011-01-17/net/mac80211/rx.c
--- compat-wireless-2011-01-17.orig/net/mac80211/rx.c	2011-01-17 21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17/net/mac80211/rx.c	2011-01-18 15:42:46.000000000 +0100
@@ -2601,7 +2601,7 @@ static int prepare_for_handlers(struct i
 		if (ieee80211_is_beacon(hdr->frame_control)) {
 			return 1;
 		}
-		else if (!ieee80211_bssid_match(bssid, sdata->u.ibss.bssid)) {
+		else if (compare_ether_addr(bssid, sdata->u.ibss.bssid)) {
 			if (!(status->rx_flags & IEEE80211_RX_IN_SCAN))
 				return 0;
 			status->rx_flags &= ~IEEE80211_RX_RA_MATCH;

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux