From owner-svn-src-user@FreeBSD.ORG Sun Sep 11 19:34:56 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 CF9AB106566C; Sun, 11 Sep 2011 19:34:56 +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 B55B38FC13; Sun, 11 Sep 2011 19:34:56 +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 p8BJYua1092640; Sun, 11 Sep 2011 19:34:56 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8BJYuwR092636; Sun, 11 Sep 2011 19:34:56 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201109111934.p8BJYuwR092636@svn.freebsd.org> From: Hiroki Sato Date: Sun, 11 Sep 2011 19:34:56 +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: r225485 - in user/hrs/ipv6/etc: . defaults rc.d 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, 11 Sep 2011 19:34:57 -0000 Author: hrs Date: Sun Sep 11 19:34:56 2011 New Revision: 225485 URL: http://svn.freebsd.org/changeset/base/225485 Log: Add $ipv6_cpe_wanif to enable functionality required for IPv6 CPE. When setting an interface name to it, the following configurations will be enabled: 1. "no_radr" is set to all IPv6 interfaces automatically. 2. "-no_radr accept_rtadv" will be set only for $ipv6_cpe_wanif. 3. The node will add RA-sending routers to the default router list even if net.inet6.ip6.forwarding=1. This mode is added to conform to RFC 6204 (a router which connects the end-user network to a service provider network). To enable packet forwarding, you still need to set ipv6_gateway_enable=YES. Note that accepting router entries into the default router list when packet forwarding capability and a routing daemon are enabled can result in messing up the routing table. To minimize such unexpected behaviors, "no_radr" is set on all interfaces but $ipv6_cpe_wanif. Modified: user/hrs/ipv6/etc/defaults/rc.conf user/hrs/ipv6/etc/network.subr user/hrs/ipv6/etc/rc.d/netoptions Modified: user/hrs/ipv6/etc/defaults/rc.conf ============================================================================== --- user/hrs/ipv6/etc/defaults/rc.conf Sun Sep 11 19:31:41 2011 (r225484) +++ user/hrs/ipv6/etc/defaults/rc.conf Sun Sep 11 19:34:56 2011 (r225485) @@ -468,6 +468,9 @@ ipv6_static_routes="" # Set to static r # route toward loopback interface. #ipv6_route_xxx="fec0:0000:0000:0006:: -prefixlen 64 ::1" ipv6_gateway_enable="NO" # Set to YES if this host will be a gateway. +ipv6_cpe_wanif="NO" # Set to the upstram interface name if this + # node will work as a router to forward IPv6 + # packets not explicitly addressed to itself. ipv6_privacy="NO" # Use privacy address on RA-receiving IFs # (RFC 4193) Modified: user/hrs/ipv6/etc/network.subr ============================================================================== --- user/hrs/ipv6/etc/network.subr Sun Sep 11 19:31:41 2011 (r225484) +++ user/hrs/ipv6/etc/network.subr Sun Sep 11 19:34:56 2011 (r225485) @@ -113,6 +113,12 @@ ifconfig_up() ;; esac + case $ipv6_cpe_wanif in + $1) + _ipv6_opts="${_ipv6_opts} -no_radr accept_rtadv" + ;; + esac + if [ -n "${_ipv6_opts}" ]; then ifconfig $1 inet6 ${_ipv6_opts} fi Modified: user/hrs/ipv6/etc/rc.d/netoptions ============================================================================== --- user/hrs/ipv6/etc/rc.d/netoptions Sun Sep 11 19:31:41 2011 (r225484) +++ user/hrs/ipv6/etc/rc.d/netoptions Sun Sep 11 19:34:56 2011 (r225485) @@ -106,6 +106,19 @@ netoptions_inet6() ${SYSCTL} net.inet6.ip6.use_tempaddr=1 >/dev/null ${SYSCTL} net.inet6.ip6.prefer_tempaddr=1 >/dev/null fi + + case $ipv6_cpe_wanif in + ""|[Nn][Oo]|[Nn][Oo][Nn][Ee]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) + ${SYSCTL} net.inet6.ip6.no_radr=0 >/dev/null + ${SYSCTL} net.inet6.ip6.rfc6204w3=0 >/dev/null + ;; + *) + netoptions_init + echo -n " IPv6 CPE WANIF=${ipv6_cpe_wanif}" + ${SYSCTL} net.inet6.ip6.no_radr=1 >/dev/null + ${SYSCTL} net.inet6.ip6.rfc6204w3=1 >/dev/null + ;; + esac } load_rc_config $name