18971c
From 10e5b14705e5bb732e66e8f08317529aa7bc8017 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Thu, 7 May 2015 14:42:10 +0200
18971c
Subject: [PATCH] network:dhcp:wait_for_ipv6_dad() in PREINIT6
18971c
18971c
---
18971c
 modules.d/40network/dhclient-script.sh | 3 ++-
18971c
 modules.d/40network/net-lib.sh         | 2 +-
18971c
 2 files changed, 3 insertions(+), 2 deletions(-)
18971c
18971c
diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
18971c
index 885303a2..aef94d6c 100755
18971c
--- a/modules.d/40network/dhclient-script.sh
18971c
+++ b/modules.d/40network/dhclient-script.sh
18971c
@@ -95,8 +95,9 @@ case $reason in
18971c
         ;;
18971c
 
18971c
     PREINIT6)
18971c
-        echo "dhcp: PREINIT $netif up"
18971c
+        echo "dhcp: PREINIT6 $netif up"
18971c
         linkup $netif
18971c
+        wait_for_ipv6_dad $netif
18971c
         ;;
18971c
 
18971c
     BOUND)
18971c
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
18971c
index 89b1101d..220480b2 100755
18971c
--- a/modules.d/40network/net-lib.sh
18971c
+++ b/modules.d/40network/net-lib.sh
18971c
@@ -522,7 +522,7 @@ wait_for_ipv6_dad() {
18971c
     local cnt=0
18971c
     local li
18971c
     while [ $cnt -lt 500 ]; do
18971c
-        li=$(ip -6 addr show dev $1)
18971c
+        li=$(ip -6 addr show dev $1 scope link)
18971c
         strstr "$li" "tentative" || return 0
18971c
         sleep 0.1
18971c
         cnt=$(($cnt+1))