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