diff options
author | Michael Tuexen <tuexen@FreeBSD.org> | 2013-03-07 23:48:29 +0000 |
---|---|---|
committer | Michael Tuexen <tuexen@FreeBSD.org> | 2013-03-07 23:48:29 +0000 |
commit | 00da398a11c2540a54ce1e7d59b462287cdc4f69 (patch) | |
tree | 89534cda3df2bb4bb1b3ca1817f2abe3397fb6bb /usr.bin | |
parent | 2daec16b04c0525709a5b0ce7c09447576a679f4 (diff) | |
download | src-00da398a11c2540a54ce1e7d59b462287cdc4f69.tar.gz src-00da398a11c2540a54ce1e7d59b462287cdc4f69.zip |
MFC r238501,r238514:
Changes which improve compilation if neither INET nor INET6 is defined.
Notes
Notes:
svn path=/stable/8/; revision=247977
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/netstat/Makefile | 4 | ||||
-rw-r--r-- | usr.bin/netstat/sctp.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile index 8f009016ff8d..57aa7170101e 100644 --- a/usr.bin/netstat/Makefile +++ b/usr.bin/netstat/Makefile @@ -13,6 +13,10 @@ CFLAGS+=-fno-strict-aliasing CFLAGS+=-DIPSEC CFLAGS+=-DSCTP +.if ${MK_INET_SUPPORT} != "no" +CFLAGS+=-DINET +.endif + .if ${MK_INET6_SUPPORT} != "no" SRCS+= inet6.c CFLAGS+=-DINET6 diff --git a/usr.bin/netstat/sctp.c b/usr.bin/netstat/sctp.c index 123633aa94cc..909ad5053c8b 100644 --- a/usr.bin/netstat/sctp.c +++ b/usr.bin/netstat/sctp.c @@ -107,6 +107,7 @@ struct xraddr_entry { * 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 @@ inetname(struct in_addr *inp) } return (line); } +#endif #ifdef INET6 static char ntop_buf[INET6_ADDRSTRLEN]; @@ -197,9 +199,11 @@ sctp_print_address(union sctp_sockstore *address, int port, int num_port) 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)); |