dracut/0038-network-ifup.sh-before-doing-dhcp-check-if-the-link-.patch
Harald Hoyer 4734ecf5fb dracut-034-62.git20131205
- fixed PATH shortener
- also install /etc/system-fips in the initramfs
- nbd, do not fail in hostonly mode
- add ohci-pci to the list of hardcoded modules
- lvm: do not run pvscan for lvmetad
- network fixes
- skip crypt swaps with password files
- fixed i18n
2013-12-05 17:38:32 +01:00

26 lines
962 B
Diff

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