From 109dad819f2b6d2c8dc28404c5f40cd936a967e2 Mon Sep 17 00:00:00 2001 From: Julian Elischer Date: Fri, 14 Jul 2006 23:32:43 +0000 Subject: [PATCH] Not having ipv6 in your kernel is not an error and should not be reported. MFC after: 1 week --- usr.bin/netstat/inet6.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c index 984f525dd53..677d82d918f 100644 --- a/usr.bin/netstat/inet6.c +++ b/usr.bin/netstat/inet6.c @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #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; }