Page MenuHomeFreeBSD

D19418.diff
No OneTemporary

D19418.diff

Index: head/usr.bin/netstat/inet.c
===================================================================
--- head/usr.bin/netstat/inet.c
+++ head/usr.bin/netstat/inet.c
@@ -85,8 +85,10 @@
#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 @@
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 @@
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 @@
} /* 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 @@
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 @@
} /* 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 @@
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 @@
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 @@
}
return (line);
}
+#endif
Index: head/usr.sbin/syslogd/syslogd.c
===================================================================
--- head/usr.sbin/syslogd/syslogd.c
+++ head/usr.sbin/syslogd/syslogd.c
@@ -1619,6 +1619,7 @@
}
}
+#if defined(INET) || defined(INET6)
static void
iovlist_truncate(struct iovlist *il, size_t size)
{
@@ -1639,6 +1640,7 @@
}
}
}
+#endif
static void
fprintlog_write(struct filed *f, struct iovlist *il, int flags)
@@ -2959,7 +2961,11 @@
* 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;
@@ -3121,13 +3127,13 @@
}
printf("port = %d\n", ap->port);
}
-#endif
return (0);
err:
if (res != NULL)
freeaddrinfo(res);
free(ap);
+#endif
return (-1);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 21, 9:47 PM (3 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25811001
Default Alt Text
D19418.diff (3 KB)

Event Timeline