From: Harald Hoyer Date: Mon, 2 Dec 2013 09:38:21 +0000 (+0100) Subject: network/ifup.sh: before doing dhcp, check, if the link has a carrier X-Git-Tag: 035~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=271cd19dbe895c24b1f70fa5c6bbecace3b97f4d;p=thirdparty%2Fdracut.git network/ifup.sh: before doing dhcp, check, if the link has a carrier --- diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh index 9f6f44949..2edcfe695 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"