diff options
Diffstat (limited to 'client/scripts/freebsd')
-rwxr-xr-x | client/scripts/freebsd | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/client/scripts/freebsd b/client/scripts/freebsd index b6d2a57a..14ab91b4 100755 --- a/client/scripts/freebsd +++ b/client/scripts/freebsd @@ -335,6 +335,42 @@ 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 |