summaryrefslogtreecommitdiffstats
path: root/sbin/ifconfig
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2012-05-11 20:01:45 +0000
committerhrs <hrs@FreeBSD.org>2012-05-11 20:01:45 +0000
commit39c22309ed9c2ffe7c028062bc1cb57b20ec6945 (patch)
tree1307b6e23ab3ebda9fef651b31225d0c4d39333c /sbin/ifconfig
parente154175378ec5ffa75830f1e8a9498d8aaded7df (diff)
downloadFreeBSD-src-39c22309ed9c2ffe7c028062bc1cb57b20ec6945.zip
FreeBSD-src-39c22309ed9c2ffe7c028062bc1cb57b20ec6945.tar.gz
Skip nd6 line with no warning message when the system does not support
INET6. Spotted by: flo
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r--sbin/ifconfig/af_nd6.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/ifconfig/af_nd6.c b/sbin/ifconfig/af_nd6.c
index eed00ea..654e2d9 100644
--- a/sbin/ifconfig/af_nd6.c
+++ b/sbin/ifconfig/af_nd6.c
@@ -148,12 +148,14 @@ nd6_status(int s)
memset(&nd, 0, sizeof(nd));
strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname));
if ((s6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
- warn("socket(AF_INET6, SOCK_DGRAM)");
+ if (errno != EPROTONOSUPPORT)
+ warn("socket(AF_INET6, SOCK_DGRAM)");
return;
}
error = ioctl(s6, SIOCGIFINFO_IN6, &nd);
if (error) {
- warn("ioctl(SIOCGIFINFO_IN6)");
+ if (errno != EPFNOSUPPORT)
+ warn("ioctl(SIOCGIFINFO_IN6)");
close(s6);
return;
}
OpenPOWER on IntegriCloud