From 07d33c069ac26ddc075f990d772216a982bce037 Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 18 Jan 2005 20:04:51 +0000 Subject: [PATCH] move beacon/probe response counting down to after we've decided whether or not we're going to process the frame; this makes the counters reflect frames actually processes instead of received (discarded frames were already counted) --- sys/net80211/ieee80211_input.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 1d258c58484..3215ed941a7 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1683,15 +1683,6 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0, u_int16_t capinfo, bintval, timoff; u_int16_t fhdwell; - if (subtype == IEEE80211_FC0_SUBTYPE_BEACON) { - /* - * Count beacon frames specially, some drivers - * use this info to do things like update LED's. - */ - ic->ic_stats.is_rx_beacon++; - IEEE80211_NODE_STAT(ni, rx_beacons); - } else - IEEE80211_NODE_STAT(ni, rx_proberesp); /* * We process beacon/probe response frames: * o when scanning, or @@ -1828,6 +1819,15 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0, return; } + /* + * Count frame now that we know it's to be processed. + */ + if (subtype == IEEE80211_FC0_SUBTYPE_BEACON) { + ic->ic_stats.is_rx_beacon++; /* XXX remove */ + IEEE80211_NODE_STAT(ni, rx_beacons); + } else + IEEE80211_NODE_STAT(ni, rx_proberesp); + /* * When operating in station mode, check for state updates. * Be careful to ignore beacons received while doing a -- 2.45.2