From owner-svn-src-user@FreeBSD.ORG Wed Sep 21 16:47:08 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED2901065672; Wed, 21 Sep 2011 16:47:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4F5B8FC13; Wed, 21 Sep 2011 16:47:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8LGl8Jc083504; Wed, 21 Sep 2011 16:47:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8LGl8SQ083502; Wed, 21 Sep 2011 16:47:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109211647.p8LGl8SQ083502@svn.freebsd.org> From: Adrian Chadd Date: Wed, 21 Sep 2011 16:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225716 - user/adrian/if_ath_tx/sys/net80211 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2011 16:47:09 -0000 Author: adrian Date: Wed Sep 21 16:47:08 2011 New Revision: 225716 URL: http://svn.freebsd.org/changeset/base/225716 Log: Add a temporary workaround to filter out some of the STA issues I'm seeing in busy 11n tests. I'm occasionally seeing frames destined for other STA's pop up from the AR9160 NIC. But I'm not seeing it from an AR9280 NIC which is also in STA mode. What would thus happen: * the frame would most likely end up entering via ieee80211_input_all(); * It would be punted to the bss node of each VAP; * It would attempt to be decrypted, and may result in the rsc being bumped to a high value and thus causing subsequent frames to fail to be RX'ed due to a suspected replay attack; * It may also end up bumping the TID sequence number, causing subsequent valid frames to also be dropped for being out of sequence. It's quite possible that this is all the result of some subtle descriptor corruption in the ath driver.... Modified: user/adrian/if_ath_tx/sys/net80211/ieee80211_sta.c Modified: user/adrian/if_ath_tx/sys/net80211/ieee80211_sta.c ============================================================================== --- user/adrian/if_ath_tx/sys/net80211/ieee80211_sta.c Wed Sep 21 13:22:36 2011 (r225715) +++ user/adrian/if_ath_tx/sys/net80211/ieee80211_sta.c Wed Sep 21 16:47:08 2011 (r225716) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -582,6 +584,25 @@ sta_input(struct ieee80211_node *ni, str vap->iv_stats.is_rx_wrongbss++; goto out; } + + /* + * Some devices may be in a promiscuous mode + * where they receive frames for multiple station + * addresses. + * + * If we receive a data frame that isn't + * destined to our VAP MAC, drop it. + */ + if (ni == vap->iv_bss + && (!(IEEE80211_IS_MULTICAST(wh->i_addr1))) + && (!IEEE80211_ADDR_EQ(wh->i_addr1, IF_LLADDR(ifp)))) { + IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, + bssid, NULL, "not to cur sta: lladdr=%6D, addr1=%6D", + IF_LLADDR(ifp), ":", wh->i_addr1, ":"); + vap->iv_stats.is_rx_wrongbss++; + goto out; + } + IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); ni->ni_noise = nf; if (HAS_SEQ(type) && !IEEE80211_IS_MULTICAST(wh->i_addr1)) {