version 1.225, 2022/10/31 20:14:45 |
version 1.226, 2022/11/01 10:45:53 |
|
|
|
|
# wait for autoconf interfaces |
# wait for autoconf interfaces |
wait_autoconf_default() { |
wait_autoconf_default() { |
|
local _count=0 |
|
|
if ifconfig | grep -q ': flags=.*<.*AUTOCONF.*>'; then |
if ifconfig | grep -q ': flags=.*<.*AUTOCONF.*>'; then |
count=0 |
while ((_count++ < 20)); do |
while ((count++ < 20)); do |
|
route -n show | grep -q ^default && break |
route -n show | grep -q ^default && break |
sleep .5 |
sleep .5 |
done |
done |
fi |
fi |
} |
} |
|
|
|
# Ensure IPv6 Duplicate Address Detection (DAD) is completed. |
|
wait_dad() { |
|
local _count=0 |
|
|
|
while ((_count++ < 10 && $(sysctl -n net.inet6.ip6.dad_pending) != 0)); do |
|
sleep 1 |
|
done |
|
} |
|
|
# Make sure the invoking user has the right privileges. Check for presence of |
# Make sure the invoking user has the right privileges. Check for presence of |
# id(1) to avoid problems with diskless setups. |
# id(1) to avoid problems with diskless setups. |
if [[ -x /usr/bin/id ]] && (($(id -u) != 0)); then |
if [[ -x /usr/bin/id ]] && (($(id -u) != 0)); then |
|
|
# Configure interfaces that rely on routing |
# Configure interfaces that rely on routing |
ifmstart "tun tap gif etherip gre egre nvgre eoip vxlan pflow wg" |
ifmstart "tun tap gif etherip gre egre nvgre eoip vxlan pflow wg" |
|
|
if $IP6KERNEL; then |
if $IP6KERNEL && ! $PRINT_ONLY; then |
# Ensure IPv6 Duplicate Address Detection (DAD) is completed. |
wait_dad |
count=0 |
|
while ((count++ < 10 && $(sysctl -n net.inet6.ip6.dad_pending) != 0)); do |
|
sleep 1 |
|
done |
|
fi |
fi |