[Midnightbsd-cvs] src [7845] trunk/usr.bin/netstat: allow for disabling INET in netstat

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Sep 14 11:39:25 EDT 2016


Revision: 7845
          http://svnweb.midnightbsd.org/src/?rev=7845
Author:   laffer1
Date:     2016-09-14 11:39:25 -0400 (Wed, 14 Sep 2016)
Log Message:
-----------
allow for disabling INET in netstat

Modified Paths:
--------------
    trunk/usr.bin/netstat/Makefile
    trunk/usr.bin/netstat/sctp.c

Modified: trunk/usr.bin/netstat/Makefile
===================================================================
--- trunk/usr.bin/netstat/Makefile	2016-09-14 15:37:26 UTC (rev 7844)
+++ trunk/usr.bin/netstat/Makefile	2016-09-14 15:39:25 UTC (rev 7845)
@@ -13,6 +13,10 @@
 CFLAGS+=-DIPSEC
 CFLAGS+=-DSCTP
 
+.if ${MK_INET_SUPPORT} != "no"
+CFLAGS+=-DINET
+.endif
+
 .if ${MK_INET6_SUPPORT} != "no"
 SRCS+=	inet6.c
 CFLAGS+=-DINET6

Modified: trunk/usr.bin/netstat/sctp.c
===================================================================
--- trunk/usr.bin/netstat/sctp.c	2016-09-14 15:37:26 UTC (rev 7844)
+++ trunk/usr.bin/netstat/sctp.c	2016-09-14 15:39:25 UTC (rev 7845)
@@ -107,6 +107,7 @@
  * If numeric_addr has been supplied, give
  * numeric value, otherwise try for symbolic name.
  */
+#ifdef INET
 static char *
 inetname(struct in_addr *inp)
 {
@@ -146,6 +147,7 @@
 	}
 	return (line);
 }
+#endif
 
 #ifdef INET6
 static char ntop_buf[INET6_ADDRSTRLEN];
@@ -197,9 +199,11 @@
 	int width;
 
 	switch (address->sa.sa_family) {
+#ifdef INET
 	case AF_INET:
 		sprintf(line, "%.*s.", Wflag ? 39 : 16, inetname(&address->sin.sin_addr));
 		break;
+#endif
 #ifdef INET6
 	case AF_INET6:
 		sprintf(line, "%.*s.", Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr));



More information about the Midnightbsd-cvs mailing list