Page MenuHomeFreeBSD

D59998.id188005.diff
No OneTemporary

D59998.id188005.diff

diff --git a/stand/common/dev_net.c b/stand/common/dev_net.c
--- a/stand/common/dev_net.c
+++ b/stand/common/dev_net.c
@@ -248,6 +248,7 @@
net_getparams(int sock)
{
char buf[MAXHOSTNAMELEN];
+ const char *val;
n_long rootaddr, smask;
#ifdef SUPPORT_BOOTP
@@ -306,6 +307,8 @@
return (EIO);
}
exit:
+ if ((val = getenv("dhcp.root-path")) != NULL)
+ strlcpy(rootpath, val, sizeof(rootpath));
if ((rootaddr = net_parse_rootpath()) != htonl(INADDR_NONE))
rootip.s_addr = rootaddr;
diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c
--- a/stand/efi/loader/main.c
+++ b/stand/efi/loader/main.c
@@ -1371,6 +1371,12 @@
devinit();
+ /*
+ * Parse command line arguments before any operation that may configure
+ * the network so DHCP overrides are available on the first attempt.
+ */
+ howto = parse_args(argc, argv);
+
/*
* If we didn't find a ipxe image, and we're netbooting, try to
* download an initmd that the dhcp server tells us about.
@@ -1383,7 +1389,6 @@
* args (eg -h) or via the UEFI ConOut variable.
*/
has_kbd = has_keyboard();
- howto = parse_args(argc, argv);
if (!has_kbd && (howto & RB_PROBE))
howto |= RB_SERIAL | RB_MULTIPLE;
howto &= ~RB_PROBE;
diff --git a/stand/libsa/bootp.c b/stand/libsa/bootp.c
--- a/stand/libsa/bootp.c
+++ b/stand/libsa/bootp.c
@@ -474,9 +474,7 @@
bcopy(cp, &rootip.s_addr, sizeof(rootip.s_addr));
}
if (tag == TAG_ROOTPATH) {
- if ((val = getenv("dhcp.root-path")) == NULL)
- val = (const char *)cp;
- strlcpy(rootpath, val, sizeof(rootpath));
+ strlcpy(rootpath, (const char *)cp, sizeof(rootpath));
}
if (tag == TAG_HOSTNAME) {
if ((val = getenv("dhcp.host-name")) == NULL)

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 6, 5:41 AM (9 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40215108
Default Alt Text
D59998.id188005.diff (1 KB)

Event Timeline