summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorCan Erkin Acar <canacar@cvs.openbsd.org>2008-06-11 17:39:52 +0000
committerCan Erkin Acar <canacar@cvs.openbsd.org>2008-06-11 17:39:52 +0000
commitf6d7b0e0fbd02a189783cf13fbf3c39f0ca11bfe (patch)
tree7dadcdf6e7ff744d6d6f0739ea8d2afdf24959c9 /sys/netinet
parentc8924fbd078f7370d6fd3fa4c77e097dfc754585 (diff)
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')
-rw-r--r--sys/netinet/ipsec_input.c7
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);