diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2018-09-10 12:47:03 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2018-09-10 12:47:03 +0000 |
commit | b32233bbbcde302220cc5f0e49771a864c6b2718 (patch) | |
tree | 9099427d83dd8ee506bda9e25e0a5bbe19cdc41d /sys/netinet6 | |
parent | e96e3be30cd1aa5b1ee0a94bf541039a6ecb4afc (diff) |
During fragment reassembly, mbuf chains with packet headers were
created. Add a new function m_removehdr() do convert packet header
mbufs within the chain to regular mbufs. Assert that the mbuf at
the beginning of the chain has a packet header.
found by Maxime Villard in NetBSD; from markus@; OK claudio@
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/frag6.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index 38631a8159a..5e8721f15e2 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frag6.c,v 1.83 2018/08/22 19:48:48 cheloha Exp $ */ +/* $OpenBSD: frag6.c,v 1.84 2018/09/10 12:47:02 bluhm Exp $ */ /* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */ /* @@ -400,6 +400,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto, int af) t = t->m_next; t->m_next = af6->ip6af_m; m_adj(t->m_next, af6->ip6af_offset); + m_removehdr(t->m_next); pool_put(&ip6af_pool, af6); } @@ -430,8 +431,10 @@ frag6_input(struct mbuf **mp, int *offp, int proto, int af) pool_put(&ip6q_pool, q6); - if (m->m_flags & M_PKTHDR) { /* Isn't it always true? */ + { int plen = 0; + + KASSERT(m->m_flags & M_PKTHDR); for (t = m; t; t = t->m_next) plen += t->m_len; m->m_pkthdr.len = plen; |