mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-15 15:06:42 +00:00
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
This commit is contained in:
parent
08adfbbf62
commit
f6e5ba31d2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=230453
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user