summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-05-23 11:29:55 -0600
committerTom Rini <[email protected]>2025-05-23 11:31:03 -0600
commitda24eb55327978410f5559f44ce1434ae8d8932d (patch)
tree441736e6e7c79637a61b8f0dab9cac2260e1e4be /cmd
parentef305ceff9c875a7c16fdffc5e120d8ddf6243b7 (diff)
parent2111bd7e93a3044f0590c942a41f2667d15d923d (diff)
Merge patch series "BOOTP/DHCPv4 enhancements"
Sean Edmond <[email protected]> says: In our datacenter application, a single DHCP server is servicing 36000+ clients. Improvements are required to the DHCPv4 retransmission behavior to align with RFC and ensure less pressure is exerted on the server: - retransmission backoff interval maximum is configurable (environment variable bootpretransmitperiodmax) - initial retransmission backoff interval is configurable (environment variable bootpretransmitperiodinit) - transaction ID is kept the same for each BOOTP/DHCPv4 request (not recreated on each retry) For our application we'll use: - bootpretransmitperiodmax=16000 - bootpretransmitperiodinit=2000 A new configuration BOOTP_RANDOM_XID has been added to enable a randomized BOOTP/DHCPv4 transaction ID. Enhance DHCPv4 sending/parsing option 209 (PXE config file). A previous patch was accepted. A new patch fixes a possible double free() and addresses latest review comments. Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig25
-rw-r--r--cmd/pxe.c2
2 files changed, 27 insertions, 0 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index f21d27cb27f..9a70c7a0b83 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1986,6 +1986,7 @@ config BOOTP_PXE_CLIENTARCH
config BOOTP_PXE_DHCP_OPTION
bool "Request & store 'pxe_configfile' from BOOTP/DHCP server"
+ default y
depends on BOOTP_PXE
config BOOTP_VCI_STRING
@@ -1996,6 +1997,30 @@ config BOOTP_VCI_STRING
default "U-Boot.arm" if ARM
default "U-Boot"
+config BOOTP_RANDOM_XID
+ bool "Send random transaction ID to BOOTP/DHCP server"
+ depends on CMD_BOOTP && (LIB_RAND || LIB_HW_RAND)
+ help
+ Selecting this will allow for a random transaction ID to get
+ selected for each BOOTP/DHCPv4 exchange.
+
+if CMD_DHCP6
+
+config DHCP6_PXE_CLIENTARCH
+ hex
+ default 0x16 if ARM64
+ default 0x15 if ARM
+ default 0xFF
+
+config DHCP6_PXE_DHCP_OPTION
+ bool "Request & store 'pxe_configfile' from DHCP6 server"
+
+config DHCP6_ENTERPRISE_ID
+ int "Enterprise ID to send in DHCPv6 Vendor Class Option"
+ default 0
+
+endif
+
config CMD_TFTPPUT
bool "tftp put"
depends on CMD_TFTPBOOT
diff --git a/cmd/pxe.c b/cmd/pxe.c
index 0f26b3b4219..71d8b542b28 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -64,6 +64,8 @@ static int pxe_dhcp_option_path(struct pxe_context *ctx, unsigned long pxefile_a
int ret = get_pxe_file(ctx, pxelinux_configfile, pxefile_addr_r);
free(pxelinux_configfile);
+ /* set to NULL to avoid double-free if DHCP is tried again */
+ pxelinux_configfile = NULL;
return ret;
}