summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-11-17 12:06:17 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-11-17 12:06:17 +0000
commit7a966a58e1aeead7454ae90c7c5cee1e4a14ce1a (patch)
tree1295d19fec073a90aca2237dc6c7406c5db3ebbf /sys/netinet
parentc524532e34a4cd52e627208c10afda9e525a461e (diff)
ip6_plen does not include the size of the ipv6 header; ok itojun
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_ether.c4
-rw-r--r--sys/netinet/ip_ipip.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/ip_ether.c b/sys/netinet/ip_ether.c
index 97e47e3bdeb..4949fb1c0bc 100644
--- a/sys/netinet/ip_ether.c
+++ b/sys/netinet/ip_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ether.c,v 1.46 2003/12/03 14:51:05 markus Exp $ */
+/* $OpenBSD: ip_ether.c,v 1.47 2004/11/17 12:06:16 markus Exp $ */
/*
* The author of this code is Angelos D. Keromytis (kermit@adk.gr)
*
@@ -400,7 +400,7 @@ etherip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
ip6->ip6_nxt = IPPROTO_ETHERIP;
ip6->ip6_vfc &= ~IPV6_VERSION_MASK;
ip6->ip6_vfc |= IPV6_VERSION;
- ip6->ip6_plen = htons(m->m_pkthdr.len);
+ ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6));
ip6->ip6_hlim = ip_defttl;
ip6->ip6_dst = tdb->tdb_dst.sin6.sin6_addr;
ip6->ip6_src = tdb->tdb_src.sin6.sin6_addr;
diff --git a/sys/netinet/ip_ipip.c b/sys/netinet/ip_ipip.c
index 5772e6e8ec7..e1aca31dc4b 100644
--- a/sys/netinet/ip_ipip.c
+++ b/sys/netinet/ip_ipip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipip.c,v 1.31 2004/06/21 20:44:54 itojun Exp $ */
+/* $OpenBSD: ip_ipip.c,v 1.32 2004/11/17 12:06:16 markus Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -540,7 +540,7 @@ ipip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
ip6o->ip6_flow = 0;
ip6o->ip6_vfc &= ~IPV6_VERSION_MASK;
ip6o->ip6_vfc |= IPV6_VERSION;
- ip6o->ip6_plen = htons(m->m_pkthdr.len);
+ ip6o->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6o));
ip6o->ip6_hlim = ip_defttl;
in6_embedscope(&ip6o->ip6_src, &tdb->tdb_src.sin6, NULL, NULL);
in6_embedscope(&ip6o->ip6_dst, &tdb->tdb_dst.sin6, NULL, NULL);