From owner-svn-src-all@freebsd.org Sat Apr 9 00:55:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B03EB074DF; Sat, 9 Apr 2016 00:55:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E4EB172E; Sat, 9 Apr 2016 00:55:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u390tukf037913; Sat, 9 Apr 2016 00:55:56 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u390tuBl037911; Sat, 9 Apr 2016 00:55:56 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604090055.u390tuBl037911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 9 Apr 2016 00:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297728 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Apr 2016 00:55:57 -0000 Author: adrian Date: Sat Apr 9 00:55:55 2016 New Revision: 297728 URL: https://svnweb.freebsd.org/changeset/base/297728 Log: [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. Modified: head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_node.h Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sat Apr 9 00:54:02 2016 (r297727) +++ head/sys/net80211/ieee80211_node.c Sat Apr 9 00:55:55 2016 (r297728) @@ -556,6 +556,33 @@ check_bss_debug(struct ieee80211vap *vap } #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_no 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), Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Sat Apr 9 00:54:02 2016 (r297727) +++ head/sys/net80211/ieee80211_node.h Sat Apr 9 00:55:55 2016 (r297728) @@ -330,6 +330,7 @@ void ieee80211_setupcurchan(struct ieee8 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 *,