diff options
author | 2007-07-13 19:59:56 +0000 | |
---|---|---|
committer | 2007-07-13 19:59:56 +0000 | |
commit | acc347de3b3a9041605547e00547eb00f1f52e3e (patch) | |
tree | 9d9fc50a9ee16ff2a8cc0b69655c93072c4d429a | |
parent | cleanup parsing of beacon and probe response mgmt frames. (diff) | |
download | wireguard-openbsd-acc347de3b3a9041605547e00547eb00f1f52e3e.tar.xz wireguard-openbsd-acc347de3b3a9041605547e00547eb00f1f52e3e.zip |
do not increment ic_stats.is_tx_nombuf in ieee80211_get_rts() and
ieee80211_get_cts_to_self() if mbuf allocation fails.
-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 *); |