Blame SOURCES/0349-network-wait_for_ifup-handle-NO-CARRIER-output.patch

18971c
From f059985b14f80a41f3b8103b67cb8fae0d3fc2fc Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Fri, 25 Sep 2015 10:14:33 -0400
18971c
Subject: [PATCH] network:wait_for_ifup() handle "NO-CARRIER" output
18971c
18971c
if "NO-CARRIER" is one of the flags, we surely have no link yet.
18971c
---
18971c
 modules.d/40network/net-lib.sh | 30 ++++++++++++++++--------------
18971c
 1 file changed, 16 insertions(+), 14 deletions(-)
18971c
18971c
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
18971c
index 60d3579a..995d32f6 100755
18971c
--- a/modules.d/40network/net-lib.sh
18971c
+++ b/modules.d/40network/net-lib.sh
18971c
@@ -531,20 +531,22 @@ wait_for_if_up() {
18971c
 
18971c
     while [ $cnt -lt $timeout ]; do
18971c
         li=$(ip -o link show up dev $1)
18971c
-        if [ -n "$li" ]; then
18971c
-            case "$li" in
18971c
-                *\
18971c
-                    return 0;;
18971c
-                *\<*,UP\>*)
18971c
-                    return 0;;
18971c
-                *\<*,UP,*\>*)
18971c
-                    return 0;;
18971c
-            esac
18971c
-        fi
18971c
-        if strstr "$li" "LOWER_UP" \
18971c
-                && strstr "$li" "state UNKNOWN" \
18971c
-                && ! strstr "$li" "DORMANT"; then
18971c
-            return 0
18971c
+        if ! strstr "$li" "NO-CARRIER"; then
18971c
+            if [ -n "$li" ]; then
18971c
+                case "$li" in
18971c
+                    *\
18971c
+                        return 0;;
18971c
+                    *\<*,UP\>*)
18971c
+                        return 0;;
18971c
+                    *\<*,UP,*\>*)
18971c
+                        return 0;;
18971c
+                esac
18971c
+            fi
18971c
+            if strstr "$li" "LOWER_UP" \
18971c
+                    && strstr "$li" "state UNKNOWN" \
18971c
+                    && ! strstr "$li" "DORMANT"; then
18971c
+                return 0
18971c
+            fi
18971c
         fi
18971c
         sleep 0.1
18971c
         cnt=$(($cnt+1))