diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2007-07-13 19:59:57 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2007-07-13 19:59:57 +0000 |
commit | baa445ceccbd2fecd7a4f719313ddb7b2f94e671 (patch) | |
tree | 3355d8b6d10c2bae6742bc2c25bc328821d30a69 /sys | |
parent | ecb101090e1cafc067c79c308b86920dc7c7eddd (diff) |
do not increment ic_stats.is_tx_nombuf in ieee80211_get_rts() and
ieee80211_get_cts_to_self() if mbuf allocation fails.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net80211/ieee80211_output.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 204ee3d3e1f..eb9812fa6a5 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_output.c,v 1.45 2007/07/06 19:00:56 damien Exp $ */ +/* $OpenBSD: ieee80211_output.c,v 1.46 2007/07/13 19:59:56 damien Exp $ */ /* $NetBSD: ieee80211_output.c,v 1.13 2004/05/31 11:02:55 dyoung Exp $ */ /*- @@ -1001,7 +1001,7 @@ ieee80211_get_probe_resp(struct ieee80211com *ic, struct ieee80211_node *ni) m = ieee80211_getmbuf(M_DONTWAIT, MT_DATA, 8 + 2 + 2 + - 2 + ni->ni_esslen + /* ssid */ + 2 + ni->ni_esslen + 2 + min(rs->rs_nrates, IEEE80211_RATE_SIZE) + 2 + ((ic->ic_phytype == IEEE80211_T_FH) ? 5 : 1) + ((ic->ic_opmode == IEEE80211_M_IBSS) ? 2 + 2 : 0) + @@ -1047,9 +1047,9 @@ ieee80211_get_probe_resp(struct ieee80211com *ic, struct ieee80211_node *ni) /*- * Authentication frame format: - * [2] Authentication algorithm number - * [2] Authentication transaction sequence number - * [2] Status code + * [2] Authentication algorithm number + * [2] Authentication transaction sequence number + * [2] Status code */ struct mbuf * ieee80211_get_auth(struct ieee80211com *ic, struct ieee80211_node *ni, @@ -1340,10 +1340,9 @@ ieee80211_get_rts(struct ieee80211com *ic, const struct ieee80211_frame *wh, struct mbuf *m; MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) { - ic->ic_stats.is_tx_nombuf++; + if (m == NULL) return NULL; - } + m->m_pkthdr.len = m->m_len = sizeof (struct ieee80211_frame_rts); rts = mtod(m, struct ieee80211_frame_rts *); @@ -1367,10 +1366,9 @@ ieee80211_get_cts_to_self(struct ieee80211com *ic, u_int16_t dur) struct mbuf *m; MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) { - ic->ic_stats.is_tx_nombuf++; + if (m == NULL) return NULL; - } + m->m_pkthdr.len = m->m_len = sizeof (struct ieee80211_frame_cts); cts = mtod(m, struct ieee80211_frame_cts *); |