summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorangelos <angelos@openbsd.org>2001-05-24 11:00:08 +0000
committerangelos <angelos@openbsd.org>2001-05-24 11:00:08 +0000
commitcbc1da9b88c1710362f167c0717214920e68c78d (patch)
tree9bd86a2d43acac5d312d8eda0df4e4d7912678e9
parentIf the copied tag container is empty, initialize it properly. (diff)
downloadwireguard-openbsd-cbc1da9b88c1710362f167c0717214920e68c78d.tar.xz
wireguard-openbsd-cbc1da9b88c1710362f167c0717214920e68c78d.zip
If the copied tag head is empty, initialize it properly. This (along
with the kern/uipc_mbuf.c commit) should solve the NFS crashes.
-rw-r--r--sys/sys/mbuf.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 405ef81dc8e..24143ffa603 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbuf.h,v 1.30 2001/05/21 05:53:38 angelos Exp $ */
+/* $OpenBSD: mbuf.h,v 1.31 2001/05/24 11:00:08 angelos Exp $ */
/* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */
/*
@@ -403,6 +403,8 @@ void _sk_mclget(struct mbuf *, int);
*/
#define M_COPY_HDR(to, from) { \
(to)->m_pkthdr = (from)->m_pkthdr; \
+ if (TAILQ_EMPTY(&(from)->m_pkthdr.tags)) \
+ TAILQ_INIT(&(to)->m_pkthdr.tags); \
}
/*
@@ -410,8 +412,8 @@ void _sk_mclget(struct mbuf *, int);
*/
#define M_DUP_HDR(to, from) { \
M_COPY_HDR((to), (from)); \
- TAILQ_INIT(&(to)->m_pkthdr.tags); \
m_tag_copy_chain((to), (from)); \
+ TAILQ_INIT(&(from)->m_pkthdr.tags); \
}
/*