summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2004-04-02 23:06:41 +0000
committersam <sam@FreeBSD.org>2004-04-02 23:06:41 +0000
commit32d170b4b8c3fb9042c49cc6798b44feecdd140d (patch)
tree6c8040a43c84d95b7b27af4d7be085f5b5d5b669 /sys/net80211
parentddc6548865e2c9e7c496dbbfdf64e8c31b68964b (diff)
downloadFreeBSD-src-32d170b4b8c3fb9042c49cc6798b44feecdd140d.zip
FreeBSD-src-32d170b4b8c3fb9042c49cc6798b44feecdd140d.tar.gz
track node allocation failure stats in ieee80211_alloc_node instead
of each caller Obtained from: madwifi
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_input.c12
-rw-r--r--sys/net80211/ieee80211_node.c2
2 files changed, 5 insertions, 9 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 035899c5..b88f4f1 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -709,10 +709,8 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
#endif
if (ni == NULL) {
ni = ieee80211_alloc_node(ic, wh->i_addr2);
- if (ni == NULL) {
- ic->ic_stats.is_rx_nodealloc++;
+ if (ni == NULL)
return;
- }
ni->ni_esslen = ssid[1];
memset(ni->ni_essid, 0, sizeof(ni->ni_essid));
memcpy(ni->ni_essid, ssid + 2, ssid[1]);
@@ -789,10 +787,8 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
if (ni == ic->ic_bss) {
ni = ieee80211_dup_bss(ic, wh->i_addr2);
- if (ni == NULL) {
- ic->ic_stats.is_rx_nodealloc++;
+ if (ni == NULL)
return;
- }
IEEE80211_DPRINTF(("%s: new req from %s\n",
__func__, ether_sprintf(wh->i_addr2)));
allocbs = 1;
@@ -869,10 +865,8 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
}
if (ni == ic->ic_bss) {
ni = ieee80211_alloc_node(ic, wh->i_addr2);
- if (ni == NULL) {
- ic->ic_stats.is_rx_nodealloc++;
+ if (ni == NULL)
return;
- }
IEEE80211_ADDR_COPY(ni->ni_bssid, ic->ic_bss->ni_bssid);
ni->ni_rssi = rssi;
ni->ni_rstamp = rstamp;
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 447b1de..65fe2a3 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -470,6 +470,8 @@ ieee80211_alloc_node(struct ieee80211com *ic, u_int8_t *macaddr)
struct ieee80211_node *ni = (*ic->ic_node_alloc)(ic);
if (ni != NULL)
ieee80211_setup_node(ic, ni, macaddr);
+ else
+ ic->ic_stats.is_rx_nodealloc++;
return ni;
}
OpenPOWER on IntegriCloud