]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network: differ between ipv6 local and global tentative
authorHarald Hoyer <harald@redhat.com>
Thu, 30 Jun 2016 09:10:35 +0000 (11:10 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 30 Mar 2017 09:34:51 +0000 (11:34 +0200)
For dhcpv6, only a non-tentative scope local address is needed.

(cherry picked from commit 42dd8928a81ba5ec244a5634813285ab6f342480)

modules.d/40network/dhclient-script.sh
modules.d/40network/net-lib.sh

index 3d9af99f24502e7194b8f257ee332a2794bcf5b6..68fe0575d395862f6e7410c710b6d5d888d9ff6a 100755 (executable)
@@ -158,7 +158,7 @@ case $reason in
     PREINIT6)
         echo "dhcp: PREINIT6 $netif up"
         linkup $netif
-        wait_for_ipv6_dad $netif
+        wait_for_ipv6_dad_link $netif
         ;;
 
     BOUND)
index 129f8b25aa9607e4324b214c50df266819218365..b86721bce3ef6918789c8cd0f9298b8dc4864268 100755 (executable)
@@ -646,16 +646,34 @@ wait_for_route_ok() {
     return 1
 }
 
+wait_for_ipv6_dad_link() {
+    local cnt=0
+    local timeout="$(getargs rd.net.timeout.ipv6dad=)"
+    timeout=${timeout:-50}
+    timeout=$(($timeout*10))
+
+    while [ $cnt -lt $timeout ]; do
+        [ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
+            && return 0
+        [ -n "$(ip -6 addr show dev "$1" scope link dadfailed)" ] \
+            && return 1
+        sleep 0.1
+        cnt=$(($cnt+1))
+    done
+    return 1
+}
+
 wait_for_ipv6_dad() {
     local cnt=0
-    local li
     local timeout="$(getargs rd.net.timeout.ipv6dad=)"
     timeout=${timeout:-50}
     timeout=$(($timeout*10))
 
     while [ $cnt -lt $timeout ]; do
-        li=$(ip -6 addr show dev $1 scope link)
-        strstr "$li" "tentative" || return 0
+        [ -z "$(ip -6 addr show dev "$1" tentative)" ] \
+            && return 0
+        [ -n "$(ip -6 addr show dev "$1" dadfailed)" ] \
+            && return 1
         sleep 0.1
         cnt=$(($cnt+1))
     done