svn commit: r222441 - user/hrs/ipv6/sbin/ifconfig
Hiroki Sato
hrs at FreeBSD.org
Sun May 29 05:12:24 UTC 2011
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);
}
More information about the svn-src-user
mailing list