From owner-svn-src-user@FreeBSD.ORG Sun May 29 05:12:24 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBE41106564A; Sun, 29 May 2011 05:12:24 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD3278FC0A; Sun, 29 May 2011 05:12:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4T5CONL015688; Sun, 29 May 2011 05:12:24 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4T5CO2J015686; Sun, 29 May 2011 05:12:24 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201105290512.p4T5CO2J015686@svn.freebsd.org> From: Hiroki Sato Date: Sun, 29 May 2011 05:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222441 - user/hrs/ipv6/sbin/ifconfig X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2011 05:12:24 -0000 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); }