[Midnightbsd-cvs] src [7855] trunk/sbin/ifconfig/af_nd6.c: skip nd6 line with no warning message when the system does not support INET6 in ifconfig

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Sep 14 12:00:17 EDT 2016


Revision: 7855
          http://svnweb.midnightbsd.org/src/?rev=7855
Author:   laffer1
Date:     2016-09-14 12:00:16 -0400 (Wed, 14 Sep 2016)
Log Message:
-----------
skip nd6 line with no warning message when the system does not support INET6 in ifconfig

Modified Paths:
--------------
    trunk/sbin/ifconfig/af_nd6.c

Modified: trunk/sbin/ifconfig/af_nd6.c
===================================================================
--- trunk/sbin/ifconfig/af_nd6.c	2016-09-14 15:58:56 UTC (rev 7854)
+++ trunk/sbin/ifconfig/af_nd6.c	2016-09-14 16:00:16 UTC (rev 7855)
@@ -148,12 +148,14 @@
 	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;
 	}



More information about the Midnightbsd-cvs mailing list