Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 May 2012 20:01:45 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r235285 - head/sbin/ifconfig
Message-ID:  <201205112001.q4BK1jXj098253@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Fri May 11 20:01:45 2012
New Revision: 235285
URL: http://svn.freebsd.org/changeset/base/235285

Log:
  Skip nd6 line with no warning message when the system does not support
  INET6.
  
  Spotted by:	flo

Modified:
  head/sbin/ifconfig/af_nd6.c

Modified: head/sbin/ifconfig/af_nd6.c
==============================================================================
--- head/sbin/ifconfig/af_nd6.c	Fri May 11 19:26:54 2012	(r235284)
+++ head/sbin/ifconfig/af_nd6.c	Fri May 11 20:01:45 2012	(r235285)
@@ -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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205112001.q4BK1jXj098253>