diff options
author | bschmidt <bschmidt@FreeBSD.org> | 2011-02-22 19:05:42 +0000 |
---|---|---|
committer | bschmidt <bschmidt@FreeBSD.org> | 2011-02-22 19:05:42 +0000 |
commit | f2afad1aeaf2ee3687e30ab2b584a8bd7a731ddf (patch) | |
tree | 1e94b233eb819904ead53a1e753f5883f71d1706 /sys/net80211/ieee80211_sta.c | |
parent | 847bf79423da130be27e1335cb954bbc52471065 (diff) | |
download | FreeBSD-src-f2afad1aeaf2ee3687e30ab2b584a8bd7a731ddf.zip FreeBSD-src-f2afad1aeaf2ee3687e30ab2b584a8bd7a731ddf.tar.gz |
Make sure to only accept and handle action frames which are for us. In
promiscuous mode we might receive stuff which otherwise gets filtered
by hardware.
Diffstat (limited to 'sys/net80211/ieee80211_sta.c')
-rw-r--r-- | sys/net80211/ieee80211_sta.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index bbfb36ef..0a5d7db 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -1719,14 +1719,19 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, case IEEE80211_FC0_SUBTYPE_ACTION: case IEEE80211_FC0_SUBTYPE_ACTION_NOACK: - if (vap->iv_state == IEEE80211_S_RUN) { - if (ieee80211_parse_action(ni, m0) == 0) - (void)ic->ic_recv_action(ni, wh, frm, efrm); - } else { + if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, wh->i_addr1) && + !IEEE80211_IS_MULTICAST(wh->i_addr1)) { + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "%s", "not for us"); + vap->iv_stats.is_rx_mgtdiscard++; + } else if (vap->iv_state != IEEE80211_S_RUN) { IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "wrong state %s", ieee80211_state_name[vap->iv_state]); vap->iv_stats.is_rx_mgtdiscard++; + } else { + if (ieee80211_parse_action(ni, m0) == 0) + (void)ic->ic_recv_action(ni, wh, frm, efrm); } break; |