diff options
author | 2008-06-11 17:39:51 +0000 | |
---|---|---|
committer | 2008-06-11 17:39:51 +0000 | |
commit | 9073e681d68677852d644e60d1d25877acc20f04 (patch) | |
tree | 9c8ffc2b5cde17efaf2f1adfa90fe9b42e90d9bb /sys/netinet/ipsec_input.c | |
parent | Move a debug printf into #ifdef DEBUG. ok todd@, millert@. (diff) | |
download | wireguard-openbsd-9073e681d68677852d644e60d1d25877acc20f04.tar.xz wireguard-openbsd-9073e681d68677852d644e60d1d25877acc20f04.zip |
fix an old typo that prevented outer ipv6 headers from being corrected,
also fix the correction amount. This was only really visible on tcpdump,
as a "truncated-ip6 - 48 bytes missing" warning. The inner packet made
it into the stack just fine, minus a few sanity checks.
reported by and debuged together with and ok todd@
Diffstat (limited to 'sys/netinet/ipsec_input.c')
-rw-r--r-- | sys/netinet/ipsec_input.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c index 13370a297be..792ebf5c337 100644 --- a/sys/netinet/ipsec_input.c +++ b/sys/netinet/ipsec_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsec_input.c,v 1.85 2007/12/14 18:33:41 deraadt Exp $ */ +/* $OpenBSD: ipsec_input.c,v 1.86 2008/06/11 17:39:51 canacar Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -412,7 +412,7 @@ ipsec_common_input_cb(struct mbuf *m, struct tdb *tdbp, int skip, int protoff, #ifdef INET6 /* Fix IPv6 header */ - if (af == INET6) + if (af == AF_INET6) { if (m->m_len < sizeof(struct ip6_hdr) && (m = m_pullup(m, sizeof(struct ip6_hdr))) == NULL) { @@ -427,8 +427,7 @@ ipsec_common_input_cb(struct mbuf *m, struct tdb *tdbp, int skip, int protoff, } ip6 = mtod(m, struct ip6_hdr *); - ip6->ip6_plen = htons(m->m_pkthdr.len - - sizeof(struct ip6_hdr)); + ip6->ip6_plen = htons(m->m_pkthdr.len - skip); /* Save protocol */ m_copydata(m, protoff, 1, (unsigned char *) &prot); |