From owner-svn-src-all@FreeBSD.ORG Mon Apr 26 15:31:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D23E1106566C; Mon, 26 Apr 2010 15:31:58 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C13D98FC18; Mon, 26 Apr 2010 15:31:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3QFVwOT023717; Mon, 26 Apr 2010 15:31:58 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3QFVwVP023713; Mon, 26 Apr 2010 15:31:58 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201004261531.o3QFVwVP023713@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 26 Apr 2010 15:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207225 - in head: etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Apr 2010 15:31:59 -0000 Author: ume Date: Mon Apr 26 15:31:58 2010 New Revision: 207225 URL: http://svn.freebsd.org/changeset/base/207225 Log: Better handling of ipv6_default_interface using net.inet6.ip6.use_defaultzone=1. Now, it works IPv6 link-local unicast addresses as well as IPv6 link-local multicast addresses. MFC after: 1 week Modified: head/etc/defaults/rc.conf head/etc/rc.d/routing head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Mon Apr 26 15:01:14 2010 (r207224) +++ head/etc/defaults/rc.conf Mon Apr 26 15:31:58 2010 (r207225) @@ -470,8 +470,8 @@ route6d_flags="" # Flags to IPv6 routin #ipv6_prefix_ed0="fec0:0000:0000:0001 fec0:0000:0000:0002" # Examples for rtr. #ipv6_prefix_ep0="fec0:0000:0000:0003 fec0:0000:0000:0004" # Examples for rtr. ipv6_default_interface="NO" # Default output interface for scoped addrs. - # Now this works only for IPv6 link local - # multicast addrs. + # This works only with + # ipv6_gateway_enable="NO". rtsol_flags="" # Flags to IPv6 router solicitation. rtsold_enable="NO" # Set to YES to enable an IPv6 router # solicitation daemon. Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Mon Apr 26 15:01:14 2010 (r207224) +++ head/etc/rc.d/routing Mon Apr 26 15:31:58 2010 (r207225) @@ -210,34 +210,24 @@ static_inet6() ;; esac - # Disallow unicast packets without outgoing scope identifiers, - # or route such packets to a "default" interface, if it is specified. + # Disallow link-local unicast packets without outgoing scope + # identifiers. However, if you set "ipv6_default_interface", + # for the host case, you will allow to omit the identifiers. + # Under this configuration, the packets will go to the default + # interface. route ${_action} -inet6 fe80:: -prefixlen 10 ::1 -reject + route ${_action} -inet6 ff02:: -prefixlen 16 ::1 -reject case ${ipv6_default_interface} in '') - route ${_action} -inet6 ff02:: -prefixlen 16 ::1 -reject ;; *) - laddr=`network6_getladdr ${ipv6_default_interface}` - route ${_action} -inet6 ff02:: ${laddr} -prefixlen 16 -interface - - # Disable installing the default interface with the - # case net.inet6.ip6.forwarding=0 and - # the interface with no ND6_IFF_ACCEPT_RTADV - # to avoid conflict between the default router list and - # the manual configured default route. + # Disable installing the default interface when we act + # as router to avoid conflict between the default + # router list and the manual configured default route. if ! checkyesno ipv6_gateway_enable; then - ifconfig ${ipv6_default_interface} nd6 | \ - while read proto options - do - case "${proto}:${options}" in - nd6:*ACCEPT_RTADV*) - ifconfig ${ipv6_default_interface} inet6 defaultif - break - ;; - esac - done + ifconfig ${ipv6_default_interface} inet6 defaultif + sysctl net.inet6.ip6.use_defaultzone=1 fi ;; esac Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Apr 26 15:01:14 2010 (r207224) +++ head/share/man/man5/rc.conf.5 Mon Apr 26 15:31:58 2010 (r207225) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2010 +.Dd April 27, 2010 .Dt RC.CONF 5 .Os .Sh NAME @@ -1370,7 +1370,7 @@ configured on that interface. If not set to .Dq Li NO , this is the default output interface for scoped addresses. -Now this works only for IPv6 link local multicast addresses. +This works only with ipv6_gateway_enable="NO". .It Va ip6addrctl_enable .Pq Vt bool If set to