Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/netstat use proper #ifdef to determine behavior (__K...



details:   https://anonhg.NetBSD.org/src/rev/1891cc4f754e
branches:  trunk
changeset: 547193:1891cc4f754e
user:      itojun <itojun%NetBSD.org@localhost>
date:      Wed May 14 23:36:32 2003 +0000

description:
use proper #ifdef to determine behavior (__KAME__)

diffstat:

 usr.bin/netstat/Makefile |   5 +----
 usr.bin/netstat/if.c     |  10 +++++-----
 usr.bin/netstat/inet6.c  |   6 +++---
 usr.bin/netstat/route.c  |  12 ++++++------
 4 files changed, 15 insertions(+), 18 deletions(-)

diffs (143 lines):

diff -r 37c7a97442ca -r 1891cc4f754e usr.bin/netstat/Makefile
--- a/usr.bin/netstat/Makefile  Wed May 14 23:16:44 2003 +0000
+++ b/usr.bin/netstat/Makefile  Wed May 14 23:36:32 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.21 2002/09/18 14:00:40 lukem Exp $
+#      $NetBSD: Makefile,v 1.22 2003/05/14 23:36:32 itojun Exp $
 #      from: @(#)Makefile      8.1 (Berkeley) 6/12/93
 
 .include <bsd.own.mk>
@@ -13,7 +13,4 @@
 DPADD= ${LIBKVM}
 CPPFLAGS+= -DINET6 -DIPSEC
 
-# KAME scope id hack
-CPPFLAGS+=-DKAME_SCOPEID
-
 .include <bsd.prog.mk>
diff -r 37c7a97442ca -r 1891cc4f754e usr.bin/netstat/if.c
--- a/usr.bin/netstat/if.c      Wed May 14 23:16:44 2003 +0000
+++ b/usr.bin/netstat/if.c      Wed May 14 23:36:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.53 2003/04/15 08:07:10 itojun Exp $   */
+/*     $NetBSD: if.c,v 1.54 2003/05/14 23:36:32 itojun Exp $   */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
 #else
-__RCSID("$NetBSD: if.c,v 1.53 2003/04/15 08:07:10 itojun Exp $");
+__RCSID("$NetBSD: if.c,v 1.54 2003/05/14 23:36:32 itojun Exp $");
 #endif
 #endif /* not lint */
 
@@ -99,7 +99,7 @@
        char name[IFNAMSIZ + 1];        /* + 1 for `*' */
        char hbuf[NI_MAXHOST];          /* for getnameinfo() */
 #ifdef INET6
-#ifdef KAME_SCOPEID
+#ifdef NI_WITHSCOPEID
        const int niflag = NI_NUMERICHOST | NI_WITHSCOPEID;
 #else
        const int niflag = NI_NUMERICHOST;
@@ -241,7 +241,7 @@
 #ifdef INET6
                        case AF_INET6:
                                sin6 = (struct sockaddr_in6 *)sa;
-#ifdef KAME_SCOPEID
+#ifdef __KAME__
                                if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
                                        sin6->sin6_scope_id =
                                                ntohs(*(u_int16_t *)
@@ -286,7 +286,7 @@
                                                sin6.sin6_len = sizeof(struct sockaddr_in6);
                                                sin6.sin6_family = AF_INET6;
                                                sin6.sin6_addr = inm.in6m_addr;
-#ifdef KAME_SCOPEID
+#ifdef __KAME__
                                                if (IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) {
                                                        sin6.sin6_scope_id =
                                                            ntohs(*(u_int16_t *)
diff -r 37c7a97442ca -r 1891cc4f754e usr.bin/netstat/inet6.c
--- a/usr.bin/netstat/inet6.c   Wed May 14 23:16:44 2003 +0000
+++ b/usr.bin/netstat/inet6.c   Wed May 14 23:36:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet6.c,v 1.26 2003/03/22 15:18:36 jdolecek Exp $      */
+/*     $NetBSD: inet6.c,v 1.27 2003/05/14 23:36:32 itojun Exp $        */
 /*     BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp   */
 
 /*
@@ -68,7 +68,7 @@
 #if 0
 static char sccsid[] = "@(#)inet.c     8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: inet6.c,v 1.26 2003/03/22 15:18:36 jdolecek Exp $");
+__RCSID("$NetBSD: inet6.c,v 1.27 2003/05/14 23:36:32 itojun Exp $");
 #endif
 #endif /* not lint */
 
@@ -1230,7 +1230,7 @@
                sin6.sin6_len = sizeof(sin6);
                sin6.sin6_family = AF_INET6;
                sin6.sin6_addr = *in6p;
-#ifdef KAME_SCOPEID
+#ifdef __KAME__
                if (IN6_IS_ADDR_LINKLOCAL(in6p)) {
                        sin6.sin6_scope_id =
                                ntohs(*(u_int16_t *)&in6p->s6_addr[2]);
diff -r 37c7a97442ca -r 1891cc4f754e usr.bin/netstat/route.c
--- a/usr.bin/netstat/route.c   Wed May 14 23:16:44 2003 +0000
+++ b/usr.bin/netstat/route.c   Wed May 14 23:36:32 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: route.c,v 1.59 2002/05/13 05:13:23 matt Exp $  */
+/*     $NetBSD: route.c,v 1.60 2003/05/14 23:36:32 itojun Exp $        */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "from: @(#)route.c      8.3 (Berkeley) 3/9/94";
 #else
-__RCSID("$NetBSD: route.c,v 1.59 2002/05/13 05:13:23 matt Exp $");
+__RCSID("$NetBSD: route.c,v 1.60 2003/05/14 23:36:32 itojun Exp $");
 #endif
 #endif /* not lint */
 
@@ -229,7 +229,7 @@
 #define        WID_GW(af)      18      /* width of gateway column */
 #else
 /* width of destination/gateway column */
-#ifdef KAME_SCOPEID
+#if 1
 /* strlen("fe80::aaaa:bbbb:cccc:dddd@gif0") == 30, strlen("/128") == 4 */
 #define        WID_DST(af)     ((af) == AF_INET6 ? (numeric_addr ? 34 : 18) : 18)
 #define        WID_GW(af)      ((af) == AF_INET6 ? (numeric_addr ? 30 : 18) : 18)
@@ -449,7 +449,7 @@
        case AF_INET6:
            {
                struct sockaddr_in6 *sa6 = (struct sockaddr_in6 *)sa;
-#ifdef KAME_SCOPEID
+#ifdef __KAME__
                struct in6_addr *in6 = &sa6->sin6_addr;
 
                /*
@@ -803,7 +803,7 @@
        u_char *p, *q;
        u_char *lim;
        int masklen, final = 0, illegal = 0;
-#ifdef KAME_SCOPEID
+#ifdef NI_WITHSCOPEID
        int flag = NI_WITHSCOPEID;
 #else
        int flag = 0;
@@ -895,7 +895,7 @@
        struct sockaddr_in6 *sa6;
 {
        static char line[NI_MAXHOST];
-#ifdef KAME_SCOPEID
+#ifdef NI_WITHSCOPEID
        int flag = NI_WITHSCOPEID;
 #else
        int flag = 0;



Home | Main Index | Thread Index | Old Index