diff options
author | bschmidt <bschmidt@FreeBSD.org> | 2011-02-21 19:59:43 +0000 |
---|---|---|
committer | bschmidt <bschmidt@FreeBSD.org> | 2011-02-21 19:59:43 +0000 |
commit | 4a678eb796530966a967308cc53226a4918751ac (patch) | |
tree | f77ffd1e3e1f1535d6cfcc3ed094387e24cbc4e5 /sys/net80211/ieee80211_mesh.c | |
parent | cd04d02c85e125f329ea68f58525788d217869b6 (diff) | |
download | FreeBSD-src-4a678eb796530966a967308cc53226a4918751ac.zip FreeBSD-src-4a678eb796530966a967308cc53226a4918751ac.tar.gz |
Add a new mgmt subtype "ACTION NO ACK" defined in 802.11n-2009, while here
clean up parts of the *_recv_mgmt() functions.
- make sure appropriate counters are bumped and debug messages are printed
- order the unhandled subtypes by value and add a few missing ones
- fix some whitespace nits
- remove duplicate code in adhoc_recv_mgmt()
- remove a useless comment, probably left in while c&p
Diffstat (limited to 'sys/net80211/ieee80211_mesh.c')
-rw-r--r-- | sys/net80211/ieee80211_mesh.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index 028fc14..2559dc0 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -1489,11 +1489,9 @@ mesh_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, ieee80211_send_proberesp(vap, wh->i_addr2, 0); break; } + case IEEE80211_FC0_SUBTYPE_ACTION: - if (vap->iv_state != IEEE80211_S_RUN) { - vap->iv_stats.is_rx_mgtdiscard++; - break; - } + case IEEE80211_FC0_SUBTYPE_ACTION_NOACK: /* * We received an action for an unknown neighbor. * XXX: wait for it to beacon or create ieee80211_node? @@ -1506,6 +1504,7 @@ mesh_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, } /* * Discard if not for us. + * XXX: if from us too? */ if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, wh->i_addr1) && !IEEE80211_IS_MULTICAST(wh->i_addr1)) { @@ -1514,21 +1513,30 @@ mesh_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, vap->iv_stats.is_rx_mgtdiscard++; break; } - /* XXX parse_action is a bit useless now */ - if (ieee80211_parse_action(ni, m0) == 0) - ic->ic_recv_action(ni, wh, frm, efrm); + if (vap->iv_state == IEEE80211_S_RUN) { + if (ieee80211_parse_action(ni, m0) == 0) + (void)ic->ic_recv_action(ni, wh, frm, efrm); + } else { + IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, + wh, NULL, "wrong state %s", + ieee80211_state_name[vap->iv_state]); + vap->iv_stats.is_rx_mgtdiscard++; + } break; - case IEEE80211_FC0_SUBTYPE_AUTH: + case IEEE80211_FC0_SUBTYPE_ASSOC_REQ: - case IEEE80211_FC0_SUBTYPE_REASSOC_REQ: case IEEE80211_FC0_SUBTYPE_ASSOC_RESP: + case IEEE80211_FC0_SUBTYPE_REASSOC_REQ: case IEEE80211_FC0_SUBTYPE_REASSOC_RESP: - case IEEE80211_FC0_SUBTYPE_DEAUTH: + case IEEE80211_FC0_SUBTYPE_ATIM: case IEEE80211_FC0_SUBTYPE_DISASSOC: + case IEEE80211_FC0_SUBTYPE_AUTH: + case IEEE80211_FC0_SUBTYPE_DEAUTH: IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "not handled"); vap->iv_stats.is_rx_mgtdiscard++; - return; + break; + default: IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY, wh, "mgt", "subtype 0x%x not handled", subtype); |