summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/if.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/netstat/if.c')
-rw-r--r--usr.bin/netstat/if.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index acea93bbf6d..8779f1bafed 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.17 1998/02/27 12:07:32 deraadt Exp $ */
+/* $OpenBSD: if.c,v 1.18 1999/12/08 12:30:17 itojun Exp $ */
/* $NetBSD: if.c,v 1.16.4.2 1996/06/07 21:46:46 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
#else
-static char *rcsid = "$OpenBSD: if.c,v 1.17 1998/02/27 12:07:32 deraadt Exp $";
+static char *rcsid = "$OpenBSD: if.c,v 1.18 1999/12/08 12:30:17 itojun Exp $";
#endif
#endif /* not lint */
@@ -88,6 +88,9 @@ intpr(interval, ifnetaddr)
union {
struct ifaddr ifa;
struct in_ifaddr in;
+#ifdef INET6
+ struct in6_ifaddr in6;
+#endif
struct ns_ifaddr ns;
struct ipx_ifaddr ipx;
struct iso_ifaddr iso;
@@ -127,6 +130,9 @@ intpr(interval, ifnetaddr)
ifaddraddr = 0;
while (ifnetaddr || ifaddraddr) {
struct sockaddr_in *sin;
+#ifdef INET6
+ struct sockaddr_in6 *sin6;
+#endif
register char *cp;
int n, m;
@@ -193,6 +199,15 @@ intpr(interval, ifnetaddr)
}
}
break;
+#ifdef INET6
+ case AF_INET6:
+ sin6 = (struct sockaddr_in6 *)sa;
+ printf("%-11.11s ",
+ netname6(&ifaddr.in6.ia_addr,
+ &ifaddr.in6.ia_prefixmask.sin6_addr));
+ printf("%-17.17s ", routename6(sin6));
+ break;
+#endif
case AF_IPX:
{
struct sockaddr_ipx *sipx =