diff options
author | adrian <adrian@FreeBSD.org> | 2016-04-09 00:55:55 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2016-04-09 00:55:55 +0000 |
commit | 9156287ee2c214457b1d3e13e8a917525b654819 (patch) | |
tree | d9c45b1968bd07fa205dbc250d0139ee31538141 /sys/net80211 | |
parent | 587ad3ebbb7c664174d14c713098341503b82961 (diff) | |
download | FreeBSD-src-9156287ee2c214457b1d3e13e8a917525b654819.zip FreeBSD-src-9156287ee2c214457b1d3e13e8a917525b654819.tar.gz |
[net8021] Pull out the ibss check code into a public function.
The ath(4) driver now sees beacons and management frames for different
BSSIDs in IBSS mode, which is a problem when you're in a very busy
IBSS environment.
So, expose this function so drivers can use it to check if the current
RX node is actually for a BSS we need to pay attention to or not.
PR: kern/208644
Sponsored by: Eva Automation. Inc.
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_node.c | 44 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.h | 1 |
2 files changed, 30 insertions, 15 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 66afb74..5590dfc 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -556,6 +556,33 @@ check_bss_debug(struct ieee80211vap *vap, struct ieee80211_node *ni) } #endif /* IEEE80211_DEBUG */ + +int +ieee80211_ibss_merge_check(struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = ni->ni_vap; + + if (ni == vap->iv_bss || + IEEE80211_ADDR_EQ(ni->ni_bssid, vap->iv_bss->ni_bssid)) { + /* unchanged, nothing to do */ + return 0; + } + + if (!check_bss(vap, ni)) { + /* capabilities mismatch */ + IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC, + "%s: merge failed, capabilities mismatch\n", __func__); +#ifdef IEEE80211_DEBUG + if (ieee80211_msg_assoc(vap)) + check_bss_debug(vap, ni); +#endif + vap->iv_stats.is_ibss_capmismatch++; + return 0; + } + + return 1; +} + /* * Handle 802.11 ad hoc network merge. The * convention, set by the Wireless Ethernet Compatibility Alliance @@ -576,22 +603,9 @@ ieee80211_ibss_merge(struct ieee80211_node *ni) struct ieee80211com *ic = ni->ni_ic; #endif - if (ni == vap->iv_bss || - IEEE80211_ADDR_EQ(ni->ni_bssid, vap->iv_bss->ni_bssid)) { - /* unchanged, nothing to do */ + if (! ieee80211_ibss_merge_check(ni)) return 0; - } - if (!check_bss(vap, ni)) { - /* capabilities mismatch */ - IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC, - "%s: merge failed, capabilities mismatch\n", __func__); -#ifdef IEEE80211_DEBUG - if (ieee80211_msg_assoc(vap)) - check_bss_debug(vap, ni); -#endif - vap->iv_stats.is_ibss_capmismatch++; - return 0; - } + IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC, "%s: new bssid %s: %s preamble, %s slot time%s\n", __func__, ether_sprintf(ni->ni_bssid), diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index e9b7393..9492fc0 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -330,6 +330,7 @@ void ieee80211_setupcurchan(struct ieee80211com *, struct ieee80211_channel *); void ieee80211_setcurchan(struct ieee80211com *, struct ieee80211_channel *); void ieee80211_update_chw(struct ieee80211com *); +int ieee80211_ibss_merge_check(struct ieee80211_node *); int ieee80211_ibss_merge(struct ieee80211_node *); struct ieee80211_scan_entry; int ieee80211_sta_join(struct ieee80211vap *, struct ieee80211_channel *, |