summaryrefslogtreecommitdiff
path: root/client/scripts/openbsd
diff options
context:
space:
mode:
Diffstat (limited to 'client/scripts/openbsd')
-rw-r--r--client/scripts/openbsd35
1 files changed, 35 insertions, 0 deletions
diff --git a/client/scripts/openbsd b/client/scripts/openbsd
index f20d0ff6..151b50aa 100644
--- a/client/scripts/openbsd
+++ b/client/scripts/openbsd
@@ -259,6 +259,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