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

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