Changeset View
Changeset View
Standalone View
Standalone View
libexec/rc/rc.d/netif
Show First 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | [0-9]*) | ||||
esac | esac | ||||
done | done | ||||
_cooked_list=${_tmp_list# } | _cooked_list=${_tmp_list# } | ||||
;; | ;; | ||||
esac | esac | ||||
done | done | ||||
_dadwait= | _dadwait= | ||||
_dadifn= | |||||
_fail= | _fail= | ||||
_ok= | _ok= | ||||
for ifn in ${_cooked_list# }; do | for ifn in ${_cooked_list# }; do | ||||
# Skip if ifn does not exist. | # Skip if ifn does not exist. | ||||
case $_func in | case $_func in | ||||
ifn_stop) | ifn_stop) | ||||
if ! ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then | if ! ${IFCONFIG_CMD} $ifn > /dev/null 2>&1; then | ||||
warn "$ifn does not exist. Skipped." | warn "$ifn does not exist. Skipped." | ||||
_fail="${_fail} ${ifn}" | _fail="${_fail} ${ifn}" | ||||
continue | continue | ||||
fi | fi | ||||
;; | ;; | ||||
esac | esac | ||||
if ${_func} ${ifn} $2; then | if ${_func} ${ifn} $2; then | ||||
_ok="${_ok} ${ifn}" | _ok="${_ok} ${ifn}" | ||||
if ipv6if ${ifn}; then | if ipv6if ${ifn} && \ | ||||
! network6_gettentative ${ifn} ; then | |||||
_dadwait=1 | _dadwait=1 | ||||
_dadifn="${_dadifn} ${ifn}" | |||||
fi | fi | ||||
else | else | ||||
_fail="${_fail} ${ifn}" | _fail="${_fail} ${ifn}" | ||||
fi | fi | ||||
done | done | ||||
# inet6 address configuration needs sleep for DAD. | # inet6 address configuration needs sleep for DAD. | ||||
case ${_func}:${_dadwait} in | case ${_func}:${_dadwait} in | ||||
ifn_start:1|ifn_vnetup:1|ifn_vnetdown:1) | ifn_start:1) | ||||
bz: Also unrelated: moving the interfaces between vnets does not need DAD as we should never move… | |||||
sleep `${SYSCTL_N} net.inet6.ip6.dad_count` | network6_waitdad "${_dadifn}" | ||||
sleep 1 | |||||
;; | ;; | ||||
esac | esac | ||||
_str= | _str= | ||||
if [ -n "${_ok}" ]; then | if [ -n "${_ok}" ]; then | ||||
case ${_func} in | case ${_func} in | ||||
ifn_start) | ifn_start) | ||||
_str='Starting' | _str='Starting' | ||||
Show All 34 Lines |
Also unrelated: moving the interfaces between vnets does not need DAD as we should never move addresses (link-local maybe on the vnetdown case) but really interface address configuration in that case is what matters and not the interface appearing.