summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-06-20 04:19:12 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-06-20 04:19:12 +0000
commitc2e843410915309e5a222fadd335c5b8496457e1 (patch)
treeea9aef8dfa73f6f80cedc3ce257044db494b4f97 /sys/netinet
parent0f517e60acc513cc3974ca8a4bd23500025c2215 (diff)
try to cope with AH6 with scoped address case better.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_ah.c8
-rw-r--r--sys/netinet/ip_ipip.c11
2 files changed, 16 insertions, 3 deletions
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c
index 6e1a2481820..2cfc5cf60fc 100644
--- a/sys/netinet/ip_ah.c
+++ b/sys/netinet/ip_ah.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ah.c,v 1.41 2000/06/18 08:23:46 angelos Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.42 2000/06/20 04:19:10 itojun Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -336,6 +336,12 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out)
ip6.ip6_vfc &= ~IPV6_VERSION_MASK;
ip6.ip6_vfc |= IPV6_VERSION;
+ /* scoped address handling */
+ if (IN6_IS_SCOPE_LINKLOCAL(&ip6.ip6_src))
+ ip6.ip6_src.s6_addr16[1] = 0;
+ if (IN6_IS_SCOPE_LINKLOCAL(&ip6.ip6_dst))
+ ip6.ip6_dst.s6_addr16[1] = 0;
+
/* Done with IPv6 header */
m_copyback(m, 0, sizeof(struct ip6_hdr), (caddr_t) &ip6);
diff --git a/sys/netinet/ip_ipip.c b/sys/netinet/ip_ipip.c
index 12638d96dfc..a6386f8ebdf 100644
--- a/sys/netinet/ip_ipip.c
+++ b/sys/netinet/ip_ipip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipip.c,v 1.2 2000/01/21 03:16:24 angelos Exp $ */
+/* $OpenBSD: ip_ipip.c,v 1.3 2000/06/20 04:19:11 itojun Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
@@ -404,7 +404,7 @@ ipip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
#endif /* INET */
#ifdef INET6
- struct ip6_hdr *ip6o;
+ struct ip6_hdr *ip6, *ip6o;
#endif /* INET6 */
/* Deal with empty TDB source/destination addresses */
@@ -510,6 +510,13 @@ ipip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
return ENOBUFS;
}
+ /* scoped address handling */
+ ip6 = mtod(m, struct ip6_hdr *);
+ if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_src))
+ ip6->ip6_src.s6_addr16[1] = 0;
+ if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_dst))
+ ip6->ip6_dst.s6_addr16[1] = 0;
+
M_PREPEND(m, sizeof(struct ip6_hdr), M_DONTWAIT);
if (m == 0)
{