summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/hifn7751.c7
-rw-r--r--sys/dev/pci/safe.c5
-rw-r--r--sys/dev/pci/ubsec.c5
-rw-r--r--sys/kern/uipc_mbuf.c10
-rw-r--r--sys/kern/uipc_mbuf2.c12
-rw-r--r--sys/net80211/ieee80211_crypto_ccmp.c6
-rw-r--r--sys/net80211/ieee80211_crypto_tkip.c6
-rw-r--r--sys/net80211/ieee80211_crypto_wep.c6
-rw-r--r--sys/net80211/ieee80211_input.c6
-rw-r--r--sys/netinet6/icmp6.c6
-rw-r--r--sys/netinet6/ip6_output.c4
-rw-r--r--sys/sys/mbuf.h8
12 files changed, 43 insertions, 38 deletions
diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c
index aa64a03f767..c2143f0f5e5 100644
--- a/sys/dev/pci/hifn7751.c
+++ b/sys/dev/pci/hifn7751.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hifn7751.c,v 1.165 2011/04/03 15:36:02 jasper Exp $ */
+/* $OpenBSD: hifn7751.c,v 1.166 2011/04/05 11:48:28 blambert Exp $ */
/*
* Invertex AEON / Hifn 7751 driver
@@ -1430,7 +1430,8 @@ hifn_crypto(struct hifn_softc *sc, struct hifn_command *cmd,
goto err_srcmap;
}
if (len == MHLEN) {
- err = m_dup_pkthdr(m0, cmd->srcu.src_m);
+ err = m_dup_pkthdr(m0, cmd->srcu.src_m,
+ M_DONTWAIT);
if (err) {
m_free(m0);
goto err_srcmap;
@@ -2739,7 +2740,7 @@ hifn_mkmbuf_chain(int totlen, struct mbuf *mtemplate)
if (m0 == NULL)
return (NULL);
if (len == MHLEN) {
- if (m_dup_pkthdr(m0, mtemplate)) {
+ if (m_dup_pkthdr(m0, mtemplate, M_DONTWAIT)) {
m_free(m0);
return (NULL);
}
diff --git a/sys/dev/pci/safe.c b/sys/dev/pci/safe.c
index 511d1a72a0d..436caa04ac0 100644
--- a/sys/dev/pci/safe.c
+++ b/sys/dev/pci/safe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: safe.c,v 1.32 2011/04/03 15:36:03 jasper Exp $ */
+/* $OpenBSD: safe.c,v 1.33 2011/04/05 11:48:28 blambert Exp $ */
/*-
* Copyright (c) 2003 Sam Leffler, Errno Consulting
@@ -807,7 +807,8 @@ safe_process(struct cryptop *crp)
goto errout;
}
if (len == MHLEN) {
- err = m_dup_pkthdr(m, re->re_src_m);
+ err = m_dup_pkthdr(m, re->re_src_m,
+ M_DONTWAIT);
if (err) {
m_free(m);
goto errout;
diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c
index a1958fa2b77..9e2402e1185 100644
--- a/sys/dev/pci/ubsec.c
+++ b/sys/dev/pci/ubsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsec.c,v 1.151 2011/04/03 15:36:03 jasper Exp $ */
+/* $OpenBSD: ubsec.c,v 1.152 2011/04/05 11:48:28 blambert Exp $ */
/*
* Copyright (c) 2000 Jason L. Wright (jason@thought.net)
@@ -1153,7 +1153,8 @@ ubsec_process(struct cryptop *crp)
goto errout;
}
if (len == MHLEN) {
- err = m_dup_pkthdr(m, q->q_src_m);
+ err = m_dup_pkthdr(m, q->q_src_m,
+ M_DONTWAIT);
if (err) {
m_freem(m);
goto errout;
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 724995ab336..af6894429de 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.151 2011/04/05 01:28:05 art Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.152 2011/04/05 11:48:28 blambert Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -662,7 +662,7 @@ m_copym0(struct mbuf *m0, int off, int len, int wait, int deep)
if (n == NULL)
goto nospace;
if (copyhdr) {
- if (m_dup_pkthdr(n, m0))
+ if (m_dup_pkthdr(n, m0, wait))
goto nospace;
if (len != M_COPYALL)
n->m_pkthdr.len = len;
@@ -1149,7 +1149,7 @@ m_split_mbuf(struct mbuf *m, int off, int wait, struct mbuf *mhdr)
}
}
- if (copyhdr && m_dup_pkthdr(mhdr, n)) {
+ if (copyhdr && m_dup_pkthdr(mhdr, n, wait)) {
m_free(n);
return (NULL);
}
@@ -1346,7 +1346,7 @@ m_trailingspace(struct mbuf *m)
* from must have M_PKTHDR set, and to must be empty.
*/
int
-m_dup_pkthdr(struct mbuf *to, struct mbuf *from)
+m_dup_pkthdr(struct mbuf *to, struct mbuf *from, int wait)
{
int error;
@@ -1358,7 +1358,7 @@ m_dup_pkthdr(struct mbuf *to, struct mbuf *from)
SLIST_INIT(&to->m_pkthdr.tags);
- if ((error = m_tag_copy_chain(to, from)) != 0)
+ if ((error = m_tag_copy_chain(to, from, wait)) != 0)
return (error);
if ((to->m_flags & M_EXT) == 0)
diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c
index 609af76bdd5..2ac80632c79 100644
--- a/sys/kern/uipc_mbuf2.c
+++ b/sys/kern/uipc_mbuf2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf2.c,v 1.33 2011/01/29 13:15:39 bluhm Exp $ */
+/* $OpenBSD: uipc_mbuf2.c,v 1.34 2011/04/05 11:48:28 blambert Exp $ */
/* $KAME: uipc_mbuf2.c,v 1.29 2001/02/14 13:42:10 itojun Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.40 1999/04/01 00:23:25 thorpej Exp $ */
@@ -223,7 +223,7 @@ m_dup1(struct mbuf *m, int off, int len, int wait)
MGETHDR(n, wait, m->m_type);
if (n == NULL)
return (NULL);
- if (m_dup_pkthdr(n, m)) {
+ if (m_dup_pkthdr(n, m, wait)) {
m_free(n);
return (NULL);
}
@@ -324,11 +324,11 @@ m_tag_find(struct mbuf *m, int type, struct m_tag *t)
/* Copy a single tag. */
struct m_tag *
-m_tag_copy(struct m_tag *t)
+m_tag_copy(struct m_tag *t, int wait)
{
struct m_tag *p;
- p = m_tag_get(t->m_tag_id, t->m_tag_len, M_NOWAIT);
+ p = m_tag_get(t->m_tag_id, t->m_tag_len, wait);
if (p == NULL)
return (NULL);
bcopy(t + 1, p + 1, t->m_tag_len); /* Copy the data */
@@ -342,13 +342,13 @@ m_tag_copy(struct m_tag *t)
* destination mbuf.
*/
int
-m_tag_copy_chain(struct mbuf *to, struct mbuf *from)
+m_tag_copy_chain(struct mbuf *to, struct mbuf *from, int wait)
{
struct m_tag *p, *t, *tprev = NULL;
m_tag_delete_chain(to);
SLIST_FOREACH(p, &from->m_pkthdr.tags, m_tag_link) {
- t = m_tag_copy(p);
+ t = m_tag_copy(p, wait);
if (t == NULL) {
m_tag_delete_chain(to);
return (ENOMEM);
diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c
index 4b246d088aa..66706439c70 100644
--- a/sys/net80211/ieee80211_crypto_ccmp.c
+++ b/sys/net80211/ieee80211_crypto_ccmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_crypto_ccmp.c,v 1.11 2010/07/20 15:36:03 matthew Exp $ */
+/* $OpenBSD: ieee80211_crypto_ccmp.c,v 1.12 2011/04/05 11:48:28 blambert Exp $ */
/*-
* Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr>
@@ -176,7 +176,7 @@ ieee80211_ccmp_encrypt(struct ieee80211com *ic, struct mbuf *m0,
MGET(n0, M_DONTWAIT, m0->m_type);
if (n0 == NULL)
goto nospace;
- if (m_dup_pkthdr(n0, m0))
+ if (m_dup_pkthdr(n0, m0, M_DONTWAIT))
goto nospace;
n0->m_pkthdr.len += IEEE80211_CCMP_HDRLEN;
n0->m_len = MHLEN;
@@ -355,7 +355,7 @@ ieee80211_ccmp_decrypt(struct ieee80211com *ic, struct mbuf *m0,
MGET(n0, M_DONTWAIT, m0->m_type);
if (n0 == NULL)
goto nospace;
- if (m_dup_pkthdr(n0, m0))
+ if (m_dup_pkthdr(n0, m0, M_DONTWAIT))
goto nospace;
n0->m_pkthdr.len -= IEEE80211_CCMP_HDRLEN + IEEE80211_CCMP_MICLEN;
n0->m_len = MHLEN;
diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c
index 08375f263ad..0ec0a927d88 100644
--- a/sys/net80211/ieee80211_crypto_tkip.c
+++ b/sys/net80211/ieee80211_crypto_tkip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_crypto_tkip.c,v 1.18 2010/07/20 15:36:03 matthew Exp $ */
+/* $OpenBSD: ieee80211_crypto_tkip.c,v 1.19 2011/04/05 11:48:28 blambert Exp $ */
/*-
* Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr>
@@ -198,7 +198,7 @@ ieee80211_tkip_encrypt(struct ieee80211com *ic, struct mbuf *m0,
MGET(n0, M_DONTWAIT, m0->m_type);
if (n0 == NULL)
goto nospace;
- if (m_dup_pkthdr(n0, m0))
+ if (m_dup_pkthdr(n0, m0, M_DONTWAIT))
goto nospace;
n0->m_pkthdr.len += IEEE80211_TKIP_HDRLEN;
n0->m_len = MHLEN;
@@ -368,7 +368,7 @@ ieee80211_tkip_decrypt(struct ieee80211com *ic, struct mbuf *m0,
MGET(n0, M_DONTWAIT, m0->m_type);
if (n0 == NULL)
goto nospace;
- if (m_dup_pkthdr(n0, m0))
+ if (m_dup_pkthdr(n0, m0, M_DONTWAIT))
goto nospace;
n0->m_pkthdr.len -= IEEE80211_TKIP_OVHD;
n0->m_len = MHLEN;
diff --git a/sys/net80211/ieee80211_crypto_wep.c b/sys/net80211/ieee80211_crypto_wep.c
index 178c10c2890..39712b87255 100644
--- a/sys/net80211/ieee80211_crypto_wep.c
+++ b/sys/net80211/ieee80211_crypto_wep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_crypto_wep.c,v 1.7 2009/09/24 16:03:10 damien Exp $ */
+/* $OpenBSD: ieee80211_crypto_wep.c,v 1.8 2011/04/05 11:48:28 blambert Exp $ */
/*-
* Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr>
@@ -95,7 +95,7 @@ ieee80211_wep_encrypt(struct ieee80211com *ic, struct mbuf *m0,
MGET(n0, M_DONTWAIT, m0->m_type);
if (n0 == NULL)
goto nospace;
- if (m_dup_pkthdr(n0, m0))
+ if (m_dup_pkthdr(n0, m0, M_DONTWAIT))
goto nospace;
n0->m_pkthdr.len += IEEE80211_WEP_HDRLEN;
n0->m_len = MHLEN;
@@ -228,7 +228,7 @@ ieee80211_wep_decrypt(struct ieee80211com *ic, struct mbuf *m0,
MGET(n0, M_DONTWAIT, m0->m_type);
if (n0 == NULL)
goto nospace;
- if (m_dup_pkthdr(n0, m0))
+ if (m_dup_pkthdr(n0, m0, M_DONTWAIT))
goto nospace;
n0->m_pkthdr.len -= IEEE80211_WEP_TOTLEN;
n0->m_len = MHLEN;
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);
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index c9889355c7f..86e7a2b3979 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icmp6.c,v 1.114 2011/04/03 13:54:21 stsp Exp $ */
+/* $OpenBSD: icmp6.c,v 1.115 2011/04/05 11:48:28 blambert Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
@@ -742,7 +742,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto)
bzero(p, 4);
bcopy(hostname, p + 4, maxhlen); /* meaningless TTL */
noff = sizeof(struct ip6_hdr);
- if (m_dup_pkthdr(n, m)) { /* just for rcvif */
+ if (m_dup_pkthdr(n, m, M_DONTWAIT)) { /* for rcvif */
m_freem(n);
break;
}
@@ -1384,7 +1384,7 @@ ni6_input(struct mbuf *m, int off)
return (NULL);
}
- if (m_dup_pkthdr(n, m)) /* just for rcvif */
+ if (m_dup_pkthdr(n, m, M_DONTWAIT)) /* just for rcvif */
goto bad;
if (replylen > MHLEN) {
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index c54fe19f1fb..29789f85136 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip6_output.c,v 1.119 2011/03/22 23:13:01 bluhm Exp $ */
+/* $OpenBSD: ip6_output.c,v 1.120 2011/04/05 11:48:28 blambert Exp $ */
/* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */
/*
@@ -1023,7 +1023,7 @@ ip6_fragment(struct mbuf *m0, int hlen, u_char nextproto, u_long mtu)
return (ENOBUFS);
*mnext = m;
mnext = &m->m_nextpkt;
- if ((error = m_dup_pkthdr(m, m0)) != 0)
+ if ((error = m_dup_pkthdr(m, m0, M_DONTWAIT)) != 0)
return (error);
m->m_data += max_linkhdr;
mhip6 = mtod(m, struct ip6_hdr *);
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index c6b5dd75972..0d2af45f4f7 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbuf.h,v 1.146 2011/04/04 14:35:31 blambert Exp $ */
+/* $OpenBSD: mbuf.h,v 1.147 2011/04/05 11:48:28 blambert Exp $ */
/* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */
/*
@@ -421,7 +421,7 @@ struct mbuf *m_devget(char *, int, int, struct ifnet *,
void m_zero(struct mbuf *);
int m_apply(struct mbuf *, int, int,
int (*)(caddr_t, caddr_t, unsigned int), caddr_t);
-int m_dup_pkthdr(struct mbuf *, struct mbuf *);
+int m_dup_pkthdr(struct mbuf *, struct mbuf *, int);
/* Packet tag routines */
struct m_tag *m_tag_get(int, int, int);
@@ -429,8 +429,8 @@ void m_tag_prepend(struct mbuf *, struct m_tag *);
void m_tag_delete(struct mbuf *, struct m_tag *);
void m_tag_delete_chain(struct mbuf *);
struct m_tag *m_tag_find(struct mbuf *, int, struct m_tag *);
-struct m_tag *m_tag_copy(struct m_tag *);
-int m_tag_copy_chain(struct mbuf *, struct mbuf *);
+struct m_tag *m_tag_copy(struct m_tag *, int);
+int m_tag_copy_chain(struct mbuf *, struct mbuf *, int);
void m_tag_init(struct mbuf *);
struct m_tag *m_tag_first(struct mbuf *);
struct m_tag *m_tag_next(struct mbuf *, struct m_tag *);