Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 May 2011 05:12:24 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r222441 - user/hrs/ipv6/sbin/ifconfig
Message-ID:  <201105290512.p4T5CO2J015686@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Sun May 29 05:12:24 2011
New Revision: 222441
URL: http://svn.freebsd.org/changeset/base/222441

Log:
  Display an nd6 line when the interface has ND6_IFF_ACCEPT_RTADV and no
  inet6 address.  This change should be useful for SLAAC-only interfaces.

Modified:
  user/hrs/ipv6/sbin/ifconfig/af_nd6.c

Modified: user/hrs/ipv6/sbin/ifconfig/af_nd6.c
==============================================================================
--- user/hrs/ipv6/sbin/ifconfig/af_nd6.c	Sun May 29 05:06:59 2011	(r222440)
+++ user/hrs/ipv6/sbin/ifconfig/af_nd6.c	Sun May 29 05:12:24 2011	(r222441)
@@ -192,8 +192,6 @@ nd6_status(int s)
 		}
 	}
 	free(buf);
-	if (!isinet6)
-		return;
 
 	memset(&nd, 0, sizeof(nd));
 	strncpy(nd.ifname, ifr.ifr_name, sizeof(nd.ifname));
@@ -209,8 +207,16 @@ nd6_status(int s)
 	}
 	isdefif = isnd6defif(s6);
 	close(s6);
+	/*
+	 * Display an nd6 line only for cases of IPv6 address + non-zero flag
+	 * or accept_rtadv flag.
+	 */
 	if (nd.ndi.flags == 0 && !isdefif)
 		return;
+	if (nd.ndi.flags & ND6_IFF_ACCEPT_RTADV)
+		isinet6 = 1;
+	if (!isinet6)
+		return;
 	printb("\tnd6 options",
 	    (unsigned int)(nd.ndi.flags | (isdefif << 15)), ND6BITS);
 	putchar('\n');
@@ -225,5 +231,6 @@ static struct afswtch af_nd6 = {
 static __constructor void
 nd6_ctor(void)
 {
+
 	af_register(&af_nd6);
 }



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