summaryrefslogtreecommitdiffstats
path: root/etc/network.subr
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2012-01-22 10:57:32 +0000
committerhrs <hrs@FreeBSD.org>2012-01-22 10:57:32 +0000
commitdcf91b59f527006825b1fe7061dbb74973314fad (patch)
treee3379882b1fc8d6fd4f6efaaeef35a3a754dcceb /etc/network.subr
parent2e7b42f00f4c77a5b169c93d458a8fdedac13c2a (diff)
downloadFreeBSD-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/network.subr')
-rw-r--r--etc/network.subr24
1 files changed, 18 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
}
OpenPOWER on IntegriCloud