From: Harald Hoyer Date: Tue, 1 Sep 2015 17:05:37 +0000 (+0200) Subject: network/ifup: do DHCP for BOOTDEV X-Git-Tag: 044~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cfdb5aa1f7aba5715f6d670e3b8b4c93d0d64a0;p=thirdparty%2Fdracut.git network/ifup: do DHCP for BOOTDEV (cherry picked from commit 7316d68353cfd6e08f007d10ea3e32fa4d083487) --- diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh index 9246da73c..366744f0f 100755 --- a/modules.d/40network/ifup.sh +++ b/modules.d/40network/ifup.sh @@ -407,11 +407,20 @@ fi # no ip option directed at our interface? if [ ! -e /tmp/net.${netif}.up ]; then - if getargs 'ip=dhcp6'; then - load_ipv6 - do_dhcp -6 - elif getargs 'ip=dhcp'; then - do_dhcp -4 + if [ -e /tmp/net.bootdev ]; then + BOOTDEV=$(cat /tmp/net.bootdev) + if [ "$netif" = "$BOOTDEV" ] || [ "$BOOTDEV" = "$(cat /sys/class/net/${netif}/address)" ]; then + load_ipv6 + do_dhcp + fi + else + if getargs 'ip=dhcp6'; then + load_ipv6 + do_dhcp -6 + fi + if getargs 'ip=dhcp'; then + do_dhcp -4 + fi fi fi