summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2006-12-13 09:02:00 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2006-12-13 09:02:00 +0000
commit1822c03e0119506f93b0225555c4af71fc3ce813 (patch)
tree5cf8326ea2f1c375a679a416e63837ad3f37cc91
parent354e8d02c6c4fb134aabdd3235dda725dc4f4537 (diff)
use IN6_IS_SCOPE_EMBED to check kernel-internal form addresses
(s6_addr16[1] filled) ok dhartmei
-rw-r--r--sys/net/pf.c4
-rw-r--r--sys/net/pf_if.c4
-rw-r--r--sys/netinet/ip_ah.c6
-rw-r--r--sys/netinet/ip_carp.c8
-rw-r--r--sys/netinet/ip_ipip.c6
5 files changed, 14 insertions, 14 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index a98efdea528..2815ebd65a7 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.519 2006/11/16 13:17:15 henning Exp $ */
+/* $OpenBSD: pf.c,v 1.520 2006/12/13 09:01:59 itojun Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -5754,7 +5754,7 @@ pf_route6(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
* If the packet is too large for the outgoing interface,
* send back an icmp6 error.
*/
- if (IN6_IS_ADDR_LINKLOCAL(&dst->sin6_addr))
+ if (IN6_IS_SCOPE_EMBED(&dst->sin6_addr))
dst->sin6_addr.s6_addr16[1] = htons(ifp->if_index);
if ((u_long)m0->m_pkthdr.len <= ifp->if_mtu) {
error = nd6_output(ifp, ifp, m0, dst, NULL);
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c
index 88207333cd9..6a15a896317 100644
--- a/sys/net/pf_if.c
+++ b/sys/net/pf_if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_if.c,v 1.45 2006/01/30 12:39:13 henning Exp $ */
+/* $OpenBSD: pf_if.c,v 1.46 2006/12/13 09:01:59 itojun Exp $ */
/*
* Copyright 2005 Henning Brauer <henning@openbsd.org>
@@ -549,7 +549,7 @@ pfi_address_add(struct sockaddr *sa, int af, int net)
p->pfra_ip4addr = ((struct sockaddr_in *)sa)->sin_addr;
else if (af == AF_INET6) {
p->pfra_ip6addr = ((struct sockaddr_in6 *)sa)->sin6_addr;
- if (IN6_IS_ADDR_LINKLOCAL(&p->pfra_ip6addr))
+ if (IN6_IS_SCOPE_EMBED(&p->pfra_ip6addr))
p->pfra_ip6addr.s6_addr16[1] = 0;
}
/* mask network address bits */
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c
index d53ac8078f3..d5fb3c6fc5f 100644
--- a/sys/netinet/ip_ah.c
+++ b/sys/netinet/ip_ah.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ah.c,v 1.85 2006/05/28 02:04:15 mcbride Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.86 2006/12/13 09:01:59 itojun Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -364,9 +364,9 @@ ah_massage_headers(struct mbuf **m0, int proto, int skip, int alg, int out)
ip6.ip6_vfc |= IPV6_VERSION;
/* Scoped address handling. */
- if (IN6_IS_SCOPE_LINKLOCAL(&ip6.ip6_src))
+ if (IN6_IS_SCOPE_EMBED(&ip6.ip6_src))
ip6.ip6_src.s6_addr16[1] = 0;
- if (IN6_IS_SCOPE_LINKLOCAL(&ip6.ip6_dst))
+ if (IN6_IS_SCOPE_EMBED(&ip6.ip6_dst))
ip6.ip6_dst.s6_addr16[1] = 0;
/* Done with IPv6 header. */
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 465ee2a93ee..61bd993ba19 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.131 2006/11/16 13:12:43 henning Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.132 2006/12/13 09:01:59 itojun Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -296,7 +296,7 @@ carp_hmac_prepare_ctx(struct carp_softc *sc, u_int8_t ctx)
memset(&cur6, 0xff, sizeof(cur6));
TAILQ_FOREACH(ifa, &sc->sc_if.if_addrlist, ifa_list) {
in6 = ifatoia6(ifa)->ia_addr.sin6_addr;
- if (IN6_IS_ADDR_LINKLOCAL(&in6)) {
+ if (IN6_IS_SCOPE_EMBED(&in6)) {
if (ctx == HMAC_NOV6LL)
continue;
in6.s6_addr16[1] = 0;
@@ -644,9 +644,9 @@ carp_proto_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af)
in6_src = ip6->ip6_src;
in6_found = ifatoia6(ifa)->ia_addr.sin6_addr;
- if (IN6_IS_ADDR_LINKLOCAL(&in6_src))
+ if (IN6_IS_SCOPE_EMBED(&in6_src))
in6_src.s6_addr16[1] = 0;
- if (IN6_IS_ADDR_LINKLOCAL(&in6_found))
+ if (IN6_IS_SCOPE_EMBED(&in6_found))
in6_found.s6_addr16[1] = 0;
if (IN6_ARE_ADDR_EQUAL(&in6_src, &in6_found)) {
m_freem(m);
diff --git a/sys/netinet/ip_ipip.c b/sys/netinet/ip_ipip.c
index 416501730a4..427f4214f1a 100644
--- a/sys/netinet/ip_ipip.c
+++ b/sys/netinet/ip_ipip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipip.c,v 1.37 2006/04/25 15:49:35 claudio Exp $ */
+/* $OpenBSD: ip_ipip.c,v 1.38 2006/12/13 09:01:59 itojun Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -498,9 +498,9 @@ ipip_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
/* scoped address handling */
ip6 = mtod(m, struct ip6_hdr *);
- if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_src))
+ if (IN6_IS_SCOPE_EMBED(&ip6->ip6_src))
ip6->ip6_src.s6_addr16[1] = 0;
- if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_dst))
+ if (IN6_IS_SCOPE_EMBED(&ip6->ip6_dst))
ip6->ip6_dst.s6_addr16[1] = 0;
M_PREPEND(m, sizeof(struct ip6_hdr), M_DONTWAIT);