boot: call dhcp_run in pxe bootmethod
A recent change tried to speed up EFI booting by not calling dhcp_run
from eth_bootdev_hunt() every time. PXE so far relied on that dhcp_run
call to get an IP address.
Fix that by adding a dhcp_run call to the pxe bootflow, with autoload
disabled to only get the ip address and nothing else.
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Fixes: 1f68057e0320 ("net: eth_bootdev_hunt() should not run DHCP")
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
diff --git a/boot/bootmeth_pxe.c b/boot/bootmeth_pxe.c
index b91e61b..6e5e0f9 100644
--- a/boot/bootmeth_pxe.c
+++ b/boot/bootmeth_pxe.c
@@ -73,6 +73,10 @@
return log_msg_ret("pxeb", -EPERM);
addr = simple_strtoul(addr_str, NULL, 16);
+ ret = dhcp_run(addr, NULL, false);
+ if (ret)
+ return log_msg_ret("dhc", ret);
+
log_debug("calling pxe_get()\n");
ret = pxe_get(addr, &bootdir, &size, false);
log_debug("pxe_get() returned %d\n", ret);