]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network/net-lib.sh(wait_for_ipv6_dad): simplify ip call
authorHarald Hoyer <harald@redhat.com>
Wed, 29 Jun 2016 15:18:46 +0000 (17:18 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 29 Jun 2016 15:19:06 +0000 (17:19 +0200)
taken from initscripts

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

index 9f767144d8000e2bed27682975cc3e6982792ee1..92154cc6a515d7b0d8f8a8d6314e5958ef065259 100755 (executable)
@@ -624,16 +624,12 @@ 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)" ] && return 0
         sleep 0.1
         cnt=$(($cnt+1))
     done