diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2011-04-05 11:48:29 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2011-04-05 11:48:29 +0000 |
commit | 94443e3a8469c3b4270194ffd9a06c03702ce903 (patch) | |
tree | a3ac085f92f3f31be825d2ee4b46a3cc2dda8a61 /sys/net80211/ieee80211_input.c | |
parent | a5b5f8337f372b5773fb995fbbf744d56eb5e396 (diff) |
Passing M_WAITOK to mbuf functions is supposed to be a contract between
the caller and the function that the function will not fail to allocate
memory and return a NULL pointer. However, m_dup_pkthdr() violates
this contract, making it possible for functions that pass M_WAITOK to
be surprised in ways that hurt.
Fix this by passing the wait flag all the way down the functions that
actually do the allocation for m_dup_pkthdr() so that we won't be
surprised.
man page update forthcoming
ok claudio@
Diffstat (limited to 'sys/net80211/ieee80211_input.c')
-rw-r--r-- | sys/net80211/ieee80211_input.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 9580bc342e8..bdb667601c3 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.118 2011/03/04 23:48:15 fgsch Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.119 2011/04/05 11:48:28 blambert Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -842,6 +842,8 @@ ieee80211_deliver_data(struct ieee80211com *ic, struct mbuf *m, * is 32 bytes while QoS+LLC is 34 bytes). Some devices are smart and * add 2 padding bytes after the 802.11 header in the QoS case so this * function is there for stupid drivers/devices only. + * + * XXX -- this is horrible */ struct mbuf * ieee80211_align_mbuf(struct mbuf *m) @@ -861,7 +863,7 @@ ieee80211_align_mbuf(struct mbuf *m) m_freem(m); return NULL; } - if (m_dup_pkthdr(n, m)) { + if (m_dup_pkthdr(n, m, M_DONTWAIT)) { m_free(n); m_freem(m); return (NULL); |