Allow netstat to be build if INET is not defined in the kernel.

Thanks to Garrett Cooper for reporting the issue.

MFC after: 3 days
X-MFC: 238501
This commit is contained in:
Michael Tuexen 2012-07-16 06:43:04 +00:00
parent 476f7f2423
commit 3dcc856b6c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238514
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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));