Blame 0036-network-net-lib.sh-wait_for_if_up-wait-for-state-UP.patch

Harald Hoyer 4734ec
From 56ee31ccfec50f40bade2127eb1fae041a81f16a Mon Sep 17 00:00:00 2001
Harald Hoyer 4734ec
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 4734ec
Date: Mon, 2 Dec 2013 10:34:18 +0100
Harald Hoyer 4734ec
Subject: [PATCH] network/net-lib.sh:wait_for_if_up() wait for "state UP"
Harald Hoyer 4734ec
Harald Hoyer 4734ec
really wait for "state UP", otherwise it returns earlier than we want
Harald Hoyer 4734ec
---
Harald Hoyer 4734ec
 modules.d/40network/net-lib.sh | 2 +-
Harald Hoyer 4734ec
 1 file changed, 1 insertion(+), 1 deletion(-)
Harald Hoyer 4734ec
Harald Hoyer 4734ec
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
Harald Hoyer 4734ec
index 88e72ec..0aa312a 100644
Harald Hoyer 4734ec
--- a/modules.d/40network/net-lib.sh
Harald Hoyer 4734ec
+++ b/modules.d/40network/net-lib.sh
Harald Hoyer 4734ec
@@ -443,7 +443,7 @@ wait_for_if_up() {
Harald Hoyer 4734ec
     local li
Harald Hoyer 4734ec
     while [ $cnt -lt 200 ]; do
Harald Hoyer 4734ec
         li=$(ip -o link show up dev $1)
Harald Hoyer 4734ec
-        [ -n "$li" ] && return 0
Harald Hoyer 4734ec
+        [ -n "$li" ] && [ -z "${li##*state UP*}" ] && return 0
Harald Hoyer 4734ec
         sleep 0.1
Harald Hoyer 4734ec
         cnt=$(($cnt+1))
Harald Hoyer 4734ec
     done