summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2006-07-14 23:32:43 +0000
committerjulian <julian@FreeBSD.org>2006-07-14 23:32:43 +0000
commit429b08f9da29cb5db6f609aeb7864082284ba089 (patch)
treef9f1baadd28917eab213e3f890b08975b8238a7e /usr.bin/netstat
parentfd85c7f61c4637d47796575f4873c0a2f57a9932 (diff)
downloadFreeBSD-src-429b08f9da29cb5db6f609aeb7864082284ba089.zip
FreeBSD-src-429b08f9da29cb5db6f609aeb7864082284ba089.tar.gz
Not having ipv6 in your kernel is not an error and should not be reported.
MFC after: 1 week
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/inet6.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c
index 984f525..677d82d 100644
--- a/usr.bin/netstat/inet6.c
+++ b/usr.bin/netstat/inet6.c
@@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$");
#include <netdb.h>
#include <stdio.h>
+#include <errno.h>
#include <string.h>
#include <unistd.h>
#include "netstat.h"
@@ -1030,7 +1031,9 @@ rip6_stats(u_long off __unused, const char *name, int af1 __unused)
mib[3] = IPV6CTL_RIP6STATS;
l = sizeof(rip6stat);
if (sysctl(mib, 4, &rip6stat, &l, NULL, 0) < 0) {
- perror("Warning: sysctl(net.inet6.ip6.rip6stats)");
+ /* Just shut up if the kernel doesn't have ipv6. */
+ if (errno != ENOENT)
+ perror("Warning: sysctl(net.inet6.ip6.rip6stats)");
return;
}
OpenPOWER on IntegriCloud