Not having ipv6 in your kernel is not an error and should not be reported.

MFC after:	1 week
This commit is contained in:
julian 2006-07-14 23:32:43 +00:00
parent fd85c7f61c
commit 429b08f9da

View File

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