From 8a3beec66e8b6f0cb1451efcc8a0f55f3bad0614 Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Fri, 11 May 2012 20:01:45 +0000 Subject: [PATCH] Skip nd6 line with no warning message when the system does not support INET6. Spotted by: flo --- sbin/ifconfig/af_nd6.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/ifconfig/af_nd6.c b/sbin/ifconfig/af_nd6.c index eed00eaf4044..654e2d97fe0b 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; }