diff options
author | hrs <hrs@FreeBSD.org> | 2011-05-29 05:12:24 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2011-05-29 05:12:24 +0000 |
commit | eeba75618c9b27faad1e2ef180870038ea161d68 (patch) | |
tree | e90352025c5e148f9e01b218f250e8bed9eb2750 | |
parent | 0f03e8d7fe9b98c0b3cc5813a2d50d28ce8c1277 (diff) | |
download | FreeBSD-src-eeba75618c9b27faad1e2ef180870038ea161d68.zip FreeBSD-src-eeba75618c9b27faad1e2ef180870038ea161d68.tar.gz |
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.
-rw-r--r-- | sbin/ifconfig/af_nd6.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sbin/ifconfig/af_nd6.c b/sbin/ifconfig/af_nd6.c index 4199852..43573c5 100644 --- a/sbin/ifconfig/af_nd6.c +++ b/sbin/ifconfig/af_nd6.c @@ -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); } |