Blame SOURCES/0049-network-ifup.sh-before-doing-dhcp-check-if-the-link-.patch

712866
From 7aa989a4fd5c29da18e9e57fb94dec253516b0c4 Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Mon, 2 Dec 2013 10:38:21 +0100
712866
Subject: [PATCH] network/ifup.sh: before doing dhcp, check, if the link has a
712866
 carrier
712866
712866
---
712866
 modules.d/40network/ifup.sh | 4 ++++
712866
 1 file changed, 4 insertions(+)
712866
712866
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
5c6c2a
index 9f6f4494..2edcfe69 100755
712866
--- a/modules.d/40network/ifup.sh
712866
+++ b/modules.d/40network/ifup.sh
712866
@@ -87,6 +87,10 @@ do_dhcp() {
712866
     # dhclient-script will mark the netif up and generate the online
712866
     # event for nfsroot
712866
     # XXX add -V vendor class and option parsing per kernel
712866
+    if ! iface_has_link $netif; then
712866
+        echo "No carrier detected"
712866
+        return 1
712866
+    fi
712866
     echo "Starting dhcp for interface $netif"
712866
     dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif \
712866
         || echo "dhcp failed"