diff options
author | hrs <hrs@FreeBSD.org> | 2012-01-22 10:57:32 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2012-01-22 10:57:32 +0000 |
commit | dcf91b59f527006825b1fe7061dbb74973314fad (patch) | |
tree | e3379882b1fc8d6fd4f6efaaeef35a3a754dcceb /etc | |
parent | 2e7b42f00f4c77a5b169c93d458a8fdedac13c2a (diff) | |
download | FreeBSD-src-dcf91b59f527006825b1fe7061dbb74973314fad.zip FreeBSD-src-dcf91b59f527006825b1fe7061dbb74973314fad.tar.gz |
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
Diffstat (limited to 'etc')
-rw-r--r-- | etc/network.subr | 24 | ||||
-rwxr-xr-x | etc/rc.d/netif | 10 |
2 files changed, 28 insertions, 6 deletions
diff --git a/etc/network.subr b/etc/network.subr index ab0fe2b..6d0de93 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -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 } diff --git a/etc/rc.d/netif b/etc/rc.d/netif index 01da302..b584f15 100755 --- a/etc/rc.d/netif +++ b/etc/rc.d/netif @@ -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 |