diff options
Diffstat (limited to 'client/scripts/netbsd')
-rwxr-xr-x | client/scripts/netbsd | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/client/scripts/netbsd b/client/scripts/netbsd index 8a5007e7..6a41edf4 100755 --- a/client/scripts/netbsd +++ b/client/scripts/netbsd @@ -265,6 +265,41 @@ if [ ${reason} = PREINIT6 ] ; then # XXX: Remove any stale addresses from aborted clients. + # We need to give the kernel some time to active interface + interface_up_wait_time=5 + for i in $(seq 0 ${interface_up_wait_time}) + do + ifconfig ${interface} | grep inactive >/dev/null 2>&1 + if [ $? -ne 0 ]; then + break; + fi + sleep 1 + done + + # Wait for duplicate address detection for this interface if the + # --dad-wait-time parameter has been specified and is greater than + # zero. + if [ ${dad_wait_time} -gt 0 ]; then + # Check if any IPv6 address on this interface is marked as + # tentative. + ifconfig ${interface} | grep inet6 | grep tentative \ + >/dev/null 2>&1 + if [ $? -eq 0 ]; then + # Wait for duplicate address detection to complete or for + # the timeout specified as --dad-wait-time. + for i in $(seq 0 $dad_wait_time) + do + # We're going to poll for the tentative flag every second. + sleep 1 + ifconfig ${interface} | grep inet6 | grep tentative \ + >/dev/null 2>&1 + if [ $? -ne 0 ]; then + break; + fi + done + fi + fi + exit_with_hooks 0 fi |