Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jan 2012 10:57:32 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r230453 - in head/etc: . rc.d
Message-ID:  <201201221057.q0MAvW5n072822@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Sun Jan 22 10:57:32 2012
New Revision: 230453
URL: http://svn.freebsd.org/changeset/base/230453

Log:
  Fix several glitches in IPv6-related knobs:
  
  - ipv6_enable + ipv6_gateway_enable should unset ACCEPT_RTADV by default for
    backward compatibility.
  
  - Configurations in ipv6_prefix_IF should be recognized even if there is no
    ifconfig_IF_ipv6.
  
  - DAD wait should be performed at once, not on a per-interface basis, if
    possible.  This fixes an issue that a system with a lot of IPv6-capable
    interfaces takes too long for booting.
  
  MFC after:	1 week

Modified:
  head/etc/network.subr
  head/etc/rc.d/netif

Modified: head/etc/network.subr
==============================================================================
--- head/etc/network.subr	Sun Jan 22 10:41:58 2012	(r230452)
+++ head/etc/network.subr	Sun Jan 22 10:57:32 2012	(r230453)
@@ -109,8 +109,10 @@ ifconfig_up()
 		# backward compatibility: $ipv6_enable
 		case $ipv6_enable in
 		[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
-			_ipv6_opts="${_ipv6_opts} accept_rtadv"
-			;;
+			if ! checkyesno ipv6_gateway_enable; then
+				_ipv6_opts="${_ipv6_opts} accept_rtadv"
+			fi
+		;;
 		esac
 
 		case $ipv6_cpe_wanif in
@@ -139,6 +141,14 @@ ifconfig_up()
 			_cfg=0
 		fi
 
+		# $ipv6_prefix_IF will be handled in
+		# ipv6_prefix_hostid_addr_common().
+		ifconfig_args=`get_if_var $1 ipv6_prefix_IF`
+		if [ -n "${ifconfig_args}" ]; then
+			ifconfig $1 inet6 -ifdisabled
+			_cfg=0
+		fi
+
 		# backward compatibility: $ipv6_ifconfig_IF
 		ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF`
 		if [ -n "${ifconfig_args}" ]; then
@@ -444,6 +454,12 @@ ipv6if()
 			return 0
 		fi
 
+		# True if $ipv6_prefix_IF is defined.
+		_tmpargs=`get_if_var $_if ipv6_prefix_IF`
+		if [ -n "${_tmpargs}" ]; then
+			return 0
+		fi
+
 		# backward compatibility: True if $ipv6_ifconfig_IF is defined.
 		_tmpargs=`get_if_var $_if ipv6_ifconfig_IF`
 		if [ -n "${_tmpargs}" ]; then
@@ -559,10 +575,6 @@ ipv6_up()
 	ipv6_prefix_hostid_addr_common ${_if} alias && _ret=0
 	ipv6_accept_rtadv_up ${_if} && _ret=0
 
-	# wait for DAD
-	sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
-	sleep 1
-
 	return $_ret
 }
 

Modified: head/etc/rc.d/netif
==============================================================================
--- head/etc/rc.d/netif	Sun Jan 22 10:41:58 2012	(r230452)
+++ head/etc/rc.d/netif	Sun Jan 22 10:57:32 2012	(r230453)
@@ -123,16 +123,26 @@ network_common()
 		_cooked_list="`list_net_interfaces`"
 	fi
 
+	_dadwait=
 	_fail=
 	_ok=
 	for ifn in ${_cooked_list}; do
 		if ${_func} ${ifn} $2; then
 			_ok="${_ok} ${ifn}"
+			if ipv6if ${ifn}; then
+				_dadwait=1
+			fi
 		else
 			_fail="${_fail} ${ifn}"
 		fi
 	done
 
+	# inet6 address configuration needs sleep for DAD.
+	if [ -n "${_dadwait}" ]; then
+		sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
+		sleep 1
+	fi
+
 	_str=
 	if [ -n "${_ok}" ]; then
 		case ${_func} in



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201221057.q0MAvW5n072822>