network/ifup.sh: before doing dhcp, check, if the link has a carrier

master
Harald Hoyer 2013-12-02 10:38:21 +01:00
parent 7c8da72c11
commit 271cd19dbe
1 changed files with 4 additions and 0 deletions

View File

@ -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"