Date: Fri, 19 Apr 2019 17:28:38 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r346403 - in stable/12: usr.bin/netstat usr.sbin/syslogd Message-ID: <201904191728.x3JHSc4Y030616@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Fri Apr 19 17:28:38 2019 New Revision: 346403 URL: https://svnweb.freebsd.org/changeset/base/346403 Log: MFC r344740: Fix compilation of world with WITHOUT_{INET,INET6}_SUPPORT or both set. Buildworld failed when both WITHOUT_INET6_SUPPORT and INET equivalent were set. Fix netstat and syslogd by applying appropriate #ifdef INET/INET6 to make world compile again. Modified: stable/12/usr.bin/netstat/inet.c stable/12/usr.sbin/syslogd/syslogd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/netstat/inet.c ============================================================================== --- stable/12/usr.bin/netstat/inet.c Fri Apr 19 17:28:28 2019 (r346402) +++ stable/12/usr.bin/netstat/inet.c Fri Apr 19 17:28:38 2019 (r346403) @@ -85,8 +85,10 @@ __FBSDID("$FreeBSD$"); #include "netstat.h" #include "nl_defs.h" -void inetprint(const char *, struct in_addr *, int, const char *, int, +#ifdef INET +static void inetprint(const char *, struct in_addr *, int, const char *, int, const int); +#endif #ifdef INET6 static int udp_done, tcp_done, sdp_done; #endif /* INET6 */ @@ -390,6 +392,7 @@ protopr(u_long off, const char *name, int af1, int pro so->so_rcv.sb_cc, so->so_snd.sb_cc); } if (numeric_port) { +#ifdef INET if (inp->inp_vflag & INP_IPV4) { inetprint("local", &inp->inp_laddr, (int)inp->inp_lport, name, 1, af1); @@ -397,8 +400,12 @@ protopr(u_long off, const char *name, int af1, int pro inetprint("remote", &inp->inp_faddr, (int)inp->inp_fport, name, 1, af1); } +#endif +#if defined(INET) && defined(INET6) + else +#endif #ifdef INET6 - else if (inp->inp_vflag & INP_IPV6) { + if (inp->inp_vflag & INP_IPV6) { inet6print("local", &inp->in6p_laddr, (int)inp->inp_lport, name, 1); if (!Lflag) @@ -407,6 +414,7 @@ protopr(u_long off, const char *name, int af1, int pro } /* else nothing printed now */ #endif /* INET6 */ } else if (inp->inp_flags & INP_ANONPORT) { +#ifdef INET if (inp->inp_vflag & INP_IPV4) { inetprint("local", &inp->inp_laddr, (int)inp->inp_lport, name, 1, af1); @@ -414,8 +422,12 @@ protopr(u_long off, const char *name, int af1, int pro inetprint("remote", &inp->inp_faddr, (int)inp->inp_fport, name, 0, af1); } +#endif +#if defined(INET) && defined(INET6) + else +#endif #ifdef INET6 - else if (inp->inp_vflag & INP_IPV6) { + if (inp->inp_vflag & INP_IPV6) { inet6print("local", &inp->in6p_laddr, (int)inp->inp_lport, name, 1); if (!Lflag) @@ -424,6 +436,7 @@ protopr(u_long off, const char *name, int af1, int pro } /* else nothing printed now */ #endif /* INET6 */ } else { +#ifdef INET if (inp->inp_vflag & INP_IPV4) { inetprint("local", &inp->inp_laddr, (int)inp->inp_lport, name, 0, af1); @@ -433,8 +446,12 @@ protopr(u_long off, const char *name, int af1, int pro inp->inp_lport != inp->inp_fport, af1); } +#endif +#if defined(INET) && defined(INET6) + else +#endif #ifdef INET6 - else if (inp->inp_vflag & INP_IPV6) { + if (inp->inp_vflag & INP_IPV6) { inet6print("local", &inp->in6p_laddr, (int)inp->inp_lport, name, 0); if (!Lflag) @@ -1314,10 +1331,11 @@ pim_stats(u_long off __unused, const char *name, int a xo_close_container(name); } +#ifdef INET /* * Pretty print an Internet address (net address + port). */ -void +static void inetprint(const char *container, struct in_addr *in, int port, const char *proto, int num_port, const int af1) { @@ -1404,3 +1422,4 @@ inetname(struct in_addr *inp) } return (line); } +#endif Modified: stable/12/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/12/usr.sbin/syslogd/syslogd.c Fri Apr 19 17:28:28 2019 (r346402) +++ stable/12/usr.sbin/syslogd/syslogd.c Fri Apr 19 17:28:38 2019 (r346403) @@ -1609,6 +1609,7 @@ iovlist_append(struct iovlist *il, const char *str) } } +#if defined(INET) || defined(INET6) static void iovlist_truncate(struct iovlist *il, size_t size) { @@ -1629,6 +1630,7 @@ iovlist_truncate(struct iovlist *il, size_t size) } } } +#endif static void fprintlog_write(struct filed *f, struct iovlist *il, int flags) @@ -2947,7 +2949,11 @@ timedout(int sig __unused) * Returns -1 on error, 0 if the argument was valid. */ static int +#if defined(INET) || defined(INET6) allowaddr(char *s) +#else +allowaddr(char *s __unused) +#endif { #if defined(INET) || defined(INET6) char *cp1, *cp2; @@ -3109,13 +3115,13 @@ allowaddr(char *s) } printf("port = %d\n", ap->port); } -#endif return (0); err: if (res != NULL) freeaddrinfo(res); free(ap); +#endif return (-1); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904191728.x3JHSc4Y030616>