]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network/net-lib.sh: auto6 wait for route ra
authorHarald Hoyer <harald@redhat.com>
Thu, 30 Jun 2016 06:52:09 +0000 (08:52 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 30 Mar 2017 09:34:51 +0000 (11:34 +0200)
Wait for a router advertised route

(cherry picked from commit 6d22a6860ea22d4b5a78d0328be4524579cece98)

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

index d52682827758fd933c9fc080a8b928d4104725f4..0c375c3f14d771d2faeff4c608b8e7ff45f5a900 100755 (executable)
@@ -664,16 +664,14 @@ wait_for_ipv6_dad() {
 
 wait_for_ipv6_auto() {
     local cnt=0
-    local li
     local timeout="$(getargs rd.net.timeout.ipv6auto=)"
     timeout=${timeout:-40}
     timeout=$(($timeout*10))
 
     while [ $cnt -lt $timeout ]; do
-        li=$(ip -6 addr show dev $1)
-        if ! strstr "$li" "tentative"; then
-            strstr "$li" "dynamic" && return 0
-        fi
+        [ -z "$(ip -6 addr show dev "$1" scope global tentative)" ] \
+            && [ -n "$(ip -6 route list proto ra dev "$1")" ] \
+            && return 0
         sleep 0.1
         cnt=$(($cnt+1))
     done