summaryrefslogtreecommitdiff
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2006-11-17 01:11:24 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2006-11-17 01:11:24 +0000
commitd47bdeb6300d8da6e915c6e5f97a3d3d6b7e4b5d (patch)
treea7a1d754c5bbab5286abc8c4377cf6af4a694d4e /usr.bin/netstat
parentf90ac2555337c72651bc65977807ddf57df6db9a (diff)
change semantics of ff01::/16 to interface local multicast
(to sync up with more recent IPv6 spec) ok from: deraadt mcbride
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/if.c7
-rw-r--r--usr.bin/netstat/inet6.c7
-rw-r--r--usr.bin/netstat/route.c16
-rw-r--r--usr.bin/netstat/show.c8
4 files changed, 23 insertions, 15 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index d7210150588..c08e746ef35 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.48 2006/05/27 19:24:01 claudio Exp $ */
+/* $OpenBSD: if.c,v 1.49 2006/11/17 01:11:23 itojun Exp $ */
/* $NetBSD: if.c,v 1.16.4.2 1996/06/07 21:46:46 thorpej Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
#else
-static char *rcsid = "$OpenBSD: if.c,v 1.48 2006/05/27 19:24:01 claudio Exp $";
+static char *rcsid = "$OpenBSD: if.c,v 1.49 2006/11/17 01:11:23 itojun Exp $";
#endif
#endif /* not lint */
@@ -252,7 +252,8 @@ intpr(int interval, u_long ifnetaddr)
m6.sin6_family = AF_INET6;
m6.sin6_addr = inm.in6m_addr;
#ifdef __KAME__
- if (IN6_IS_ADDR_MC_LINKLOCAL(&m6.sin6_addr)) {
+ if (IN6_IS_ADDR_MC_LINKLOCAL(&m6.sin6_addr) ||
+ IN6_IS_ADDR_MC_INTFACELOCAL(&m6.sin6_addr)) {
m6.sin6_scope_id =
ntohs(*(u_int16_t *)
&m6.sin6_addr.s6_addr[2]);
diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c
index 0fe8406d427..7d790da2a5e 100644
--- a/usr.bin/netstat/inet6.c
+++ b/usr.bin/netstat/inet6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inet6.c,v 1.32 2005/03/25 17:01:03 jaredy Exp $ */
+/* $OpenBSD: inet6.c,v 1.33 2006/11/17 01:11:23 itojun Exp $ */
/* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */
/*
* Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
-/*__RCSID("$OpenBSD: inet6.c,v 1.32 2005/03/25 17:01:03 jaredy Exp $");*/
+/*__RCSID("$OpenBSD: inet6.c,v 1.33 2006/11/17 01:11:23 itojun Exp $");*/
/*__RCSID("KAME Id: inet6.c,v 1.10 2000/02/09 10:49:31 itojun Exp");*/
#endif
#endif /* not lint */
@@ -1111,7 +1111,8 @@ inet6name(struct in6_addr *in6p)
sin6.sin6_addr = *in6p;
#ifdef __KAME__
if (IN6_IS_ADDR_LINKLOCAL(in6p) ||
- IN6_IS_ADDR_MC_LINKLOCAL(in6p)) {
+ IN6_IS_ADDR_MC_LINKLOCAL(in6p) ||
+ IN6_IS_ADDR_MC_INTFACELOCAL(in6p)) {
sin6.sin6_scope_id =
ntohs(*(u_int16_t *)&in6p->s6_addr[2]);
sin6.sin6_addr.s6_addr[2] = 0;
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index c0688220b0b..7494730ebe6 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.73 2006/08/29 21:51:13 claudio Exp $ */
+/* $OpenBSD: route.c,v 1.74 2006/11/17 01:11:23 itojun Exp $ */
/* $NetBSD: route.c,v 1.15 1996/05/07 02:55:06 thorpej Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
#else
-static char *rcsid = "$OpenBSD: route.c,v 1.73 2006/08/29 21:51:13 claudio Exp $";
+static char *rcsid = "$OpenBSD: route.c,v 1.74 2006/11/17 01:11:23 itojun Exp $";
#endif
#endif /* not lint */
@@ -388,7 +388,8 @@ encap_print(struct rtentry *rt)
bcopy(&sen1.sen_ip6_src, &s61.sin6_addr, sizeof(struct in6_addr));
#ifdef __KAME__
if (IN6_IS_ADDR_LINKLOCAL(&s61.sin6_addr) ||
- IN6_IS_ADDR_MC_LINKLOCAL(&s61.sin6_addr)) {
+ IN6_IS_ADDR_MC_LINKLOCAL(&s61.sin6_addr) ||
+ IN6_IS_ADDR_MC_INTFACELOCAL(&s61.sin6_addr)) {
s61.sin6_scope_id =
((u_int16_t)s61.sin6_addr.s6_addr[2] << 8) |
s61.sin6_addr.s6_addr[3];
@@ -398,7 +399,8 @@ encap_print(struct rtentry *rt)
bcopy(&sen2.sen_ip6_src, &s62.sin6_addr, sizeof(struct in6_addr));
#ifdef __KAME__
if (IN6_IS_ADDR_LINKLOCAL(&s62.sin6_addr) ||
- IN6_IS_ADDR_MC_LINKLOCAL(&s62.sin6_addr)) {
+ IN6_IS_ADDR_MC_LINKLOCAL(&s62.sin6_addr) ||
+ IN6_IS_ADDR_MC_INTFACELOCAL(&s62.sin6_addr)) {
s62.sin6_scope_id =
((u_int16_t)s62.sin6_addr.s6_addr[2] << 8) |
s62.sin6_addr.s6_addr[3];
@@ -416,7 +418,8 @@ encap_print(struct rtentry *rt)
bcopy(&sen1.sen_ip6_dst, &s61.sin6_addr, sizeof(struct in6_addr));
#ifdef __KAME__
if (IN6_IS_ADDR_LINKLOCAL(&s61.sin6_addr) ||
- IN6_IS_ADDR_MC_LINKLOCAL(&s61.sin6_addr)) {
+ IN6_IS_ADDR_MC_LINKLOCAL(&s61.sin6_addr) ||
+ IN6_IS_ADDR_MC_INTFACELOCAL(&s61.sin6_addr)) {
s61.sin6_scope_id =
((u_int16_t)s61.sin6_addr.s6_addr[2] << 8) |
s61.sin6_addr.s6_addr[3];
@@ -426,7 +429,8 @@ encap_print(struct rtentry *rt)
bcopy(&sen2.sen_ip6_dst, &s62.sin6_addr, sizeof(struct in6_addr));
#ifdef __KAME__
if (IN6_IS_ADDR_LINKLOCAL(&s62.sin6_addr) ||
- IN6_IS_ADDR_MC_LINKLOCAL(&s62.sin6_addr)) {
+ IN6_IS_ADDR_MC_LINKLOCAL(&s62.sin6_addr) ||
+ IN6_IS_ADDR_MC_INTFACELOCAL(&s62.sin6_addr)) {
s62.sin6_scope_id =
((u_int16_t)s62.sin6_addr.s6_addr[2] << 8) |
s62.sin6_addr.s6_addr[3];
diff --git a/usr.bin/netstat/show.c b/usr.bin/netstat/show.c
index 4bc98b06223..ac9f811a08d 100644
--- a/usr.bin/netstat/show.c
+++ b/usr.bin/netstat/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.2 2006/05/30 19:42:58 todd Exp $ */
+/* $OpenBSD: show.c,v 1.3 2006/11/17 01:11:23 itojun Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -472,7 +472,8 @@ p_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags, int width)
* sin6_scope_id field of SA should be set in the future.
*/
if (IN6_IS_ADDR_LINKLOCAL(in6) ||
- IN6_IS_ADDR_MC_LINKLOCAL(in6)) {
+ IN6_IS_ADDR_MC_LINKLOCAL(in6) ||
+ IN6_IS_ADDR_MC_INTFACELOCAL(in6)) {
/* XXX: override is ok? */
sa6->sin6_scope_id = (u_int32_t)ntohs(*(u_short *)
&in6->s6_addr[2]);
@@ -553,7 +554,8 @@ routename(struct sockaddr *sa)
sin6.sin6_family = AF_INET6;
if (sa->sa_len == sizeof(struct sockaddr_in6) &&
(IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) ||
- IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) &&
+ IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) ||
+ IN6_IS_ADDR_MC_INTFACELOCAL(&sin6.sin6_addr)) &&
sin6.sin6_scope_id == 0) {
sin6.sin6_scope_id =
ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]);