]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network: iface_has_carrier(): fixed logic
authorHarald Hoyer <harald@redhat.com>
Thu, 5 Jul 2018 07:36:32 +0000 (09:36 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 5 Jul 2018 07:37:10 +0000 (09:37 +0200)
modules.d/40network/net-lib.sh

index eac1c5ebef7df565719f39d1ebcf23e5daa02539..1e7f1b330250ff4502250c5eb4146c07f573b53c 100755 (executable)
@@ -726,8 +726,12 @@ iface_has_carrier() {
 
     while [ $cnt -lt $timeout ]; do
         if [ -n "$_no_carrier_flag" ]; then
+            li=$(ip -o link show up dev $1)
             # NO-CARRIER flag was cleared
             strstr "$li" "NO-CARRIER" || return 0
+        elif ! [ -e "$interface/carrier" ]; then
+            # sysfs not available and "NO-CARRIER" not displayed
+            return 0
         fi
         # double check the syscfs carrier flag
         [ -e "$interface/carrier" ] && [ "$(cat $interface/carrier)" = 1 ] && return 0