summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_crypto.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-10-17 23:15:30 +0000
committersam <sam@FreeBSD.org>2003-10-17 23:15:30 +0000
commiteefb2fc9e8f438d77d0a751443e37ff4080badea (patch)
tree6cc4a6d752144811e98d032820b1416b3a47c82b /sys/net80211/ieee80211_crypto.c
parenta6b5975f25a617aae0e598cdc6921a1f616754d6 (diff)
downloadFreeBSD-src-eefb2fc9e8f438d77d0a751443e37ff4080badea.zip
FreeBSD-src-eefb2fc9e8f438d77d0a751443e37ff4080badea.tar.gz
add statistics for all failures and/or abnormal events; still need
to add per-node statistics
Diffstat (limited to 'sys/net80211/ieee80211_crypto.c')
-rw-r--r--sys/net80211/ieee80211_crypto.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c
index 25a2c8b..6cb9ee0 100644
--- a/sys/net80211/ieee80211_crypto.c
+++ b/sys/net80211/ieee80211_crypto.c
@@ -113,16 +113,23 @@ ieee80211_wep_crypt(struct ifnet *ifp, struct mbuf *m0, int txflag)
n0 = NULL;
if ((ctx = ic->ic_wep_ctx) == NULL) {
ctx = malloc(arc4_ctxlen(), M_DEVBUF, M_NOWAIT);
- if (ctx == NULL)
+ if (ctx == NULL) {
+ ic->ic_stats.is_crypto_nomem++;
goto fail;
+ }
ic->ic_wep_ctx = ctx;
}
m = m0;
left = m->m_pkthdr.len;
MGET(n, M_DONTWAIT, m->m_type);
n0 = n;
- if (n == NULL)
+ if (n == NULL) {
+ if (txflag)
+ ic->ic_stats.is_tx_nombuf++;
+ else
+ ic->ic_stats.is_rx_nombuf++;
goto fail;
+ }
M_MOVE_PKTHDR(n, m);
len = IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN;
if (txflag) {
@@ -188,8 +195,13 @@ ieee80211_wep_crypt(struct ifnet *ifp, struct mbuf *m0, int txflag)
len = n->m_len - noff;
if (len == 0) {
MGET(n->m_next, M_DONTWAIT, n->m_type);
- if (n->m_next == NULL)
+ if (n->m_next == NULL) {
+ if (txflag)
+ ic->ic_stats.is_tx_nombuf++;
+ else
+ ic->ic_stats.is_rx_nombuf++;
goto fail;
+ }
n = n->m_next;
n->m_len = MLEN;
if (left >= MINCLSIZE) {
@@ -223,8 +235,10 @@ ieee80211_wep_crypt(struct ifnet *ifp, struct mbuf *m0, int txflag)
else {
n->m_len = noff;
MGET(n->m_next, M_DONTWAIT, n->m_type);
- if (n->m_next == NULL)
+ if (n->m_next == NULL) {
+ ic->ic_stats.is_tx_nombuf++;
goto fail;
+ }
n = n->m_next;
n->m_len = sizeof(crcbuf);
noff = 0;
@@ -252,6 +266,7 @@ ieee80211_wep_crypt(struct ifnet *ifp, struct mbuf *m0, int txflag)
n0->m_len, -1, -1);
}
#endif
+ ic->ic_stats.is_rx_decryptcrc++;
goto fail;
}
}
OpenPOWER on IntegriCloud