diff options
author | 2001-06-26 19:58:57 +0000 | |
---|---|---|
committer | 2001-06-26 19:58:57 +0000 | |
commit | 1e2390d33b02d21fa7616bdb90cb05202cad7171 (patch) | |
tree | 8850e134b2ed819a5b28f73c0475be20dd3c91fa | |
parent | ifdef out some currently unused code (diff) | |
download | wireguard-openbsd-1e2390d33b02d21fa7616bdb90cb05202cad7171.tar.xz wireguard-openbsd-1e2390d33b02d21fa7616bdb90cb05202cad7171.zip |
modify m_pkthdr.len computation to work with both 4.4BSD M_COPY_PKTHDR
and openbsd 2.9+ M_COPY_PKTHDR. discussed with angelos. sync with kame.
XXX it is bad to change behavior of existing macro without name change...
new behavior will be renamed M_MOVE_PKTHDR soon.
-rw-r--r-- | sys/netinet6/icmp6.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index e9ca365a1e0..32a4078bb2f 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.45 2001/06/25 02:59:01 angelos Exp $ */ +/* $OpenBSD: icmp6.c,v 1.46 2001/06/26 19:58:57 itojun Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -618,14 +618,15 @@ icmp6_input(mp, offp, proto) nicmp6 = (struct icmp6_hdr *)(nip6 + 1); bcopy(icmp6, nicmp6, sizeof(struct icmp6_hdr)); noff = sizeof(struct ip6_hdr); - n->m_pkthdr.len = n->m_len = - noff + sizeof(struct icmp6_hdr); + n->m_len = noff + sizeof(struct icmp6_hdr); /* * Adjust mbuf. ip6_plen will be adjusted in * ip6_output(). + * n->m_pkthdr.len == n0->m_pkthdr.len at this point. */ + n->m_pkthdr.len += noff + sizeof(struct icmp6_hdr); + n->m_pkthdr.len -= (off + sizeof(struct icmp6_hdr)); m_adj(n0, off + sizeof(struct icmp6_hdr)); - n->m_pkthdr.len += n0->m_pkthdr.len; n->m_next = n0; } else { nip6 = mtod(n, struct ip6_hdr *); |