Skip to content
Snippets Groups Projects
Commit 157a4997 authored by Kareen Arutjunjan's avatar Kareen Arutjunjan
Browse files

Updates for migration from Petalinux 2021.2 to 2023.2

parent 3e41d2f9
Branches update-2023.2
No related tags found
1 merge request!1Updates for migration from Petalinux 2021.2 to 2023.2
......@@ -26,7 +26,7 @@ index 0000000000..38070e5d0f
+int string_to_clientid(const char *str, u8 *clientid, size_t size);
+void print_clientid(const u8 *clientid, size_t len);
+
+void construct_dhcp_clientid(unsigned int hw_addr, unsigned int ipmb_addr, unsigned int site_number, unsigned int site_type, const char *shelf_addr);
+void construct_dhcp_clientid(unsigned int hw_addr, const char *ipmb_addr, unsigned int site_number, unsigned int site_type, const char *shelf_addr);
+
+#endif
\ No newline at end of file
......@@ -34,7 +34,7 @@ diff --git a/net/Kconfig b/net/Kconfig
index cabe93c6bd..e399cc11c4 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -99,4 +99,10 @@ config SERVERIP_FROM_PROXYDHCP_DELAY_MS
@@ -144,6 +144,12 @@
receiving response from main DHCP server. Has no effect if
SERVERIP_FROM_PROXYDHCP is false.
......@@ -44,15 +44,17 @@ index cabe93c6bd..e399cc11c4 100644
+ help
+ Add the Client Identifier option to DHCP requests.
+
endif # if NET
config KEEP_SERVERADDR
bool "Write the server's MAC address to 'serveraddr'"
default y if SANDBOX
diff --git a/net/Makefile b/net/Makefile
index fb3eba840f..7b0c5168d6 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_CMD_TFTPBOOT) += tftp.o
obj-$(CONFIG_UDP_FUNCTION_FASTBOOT) += fastboot.o
obj-$(CONFIG_CMD_WOL) += wol.o
@@ -35,6 +35,7 @@
obj-$(CONFIG_PROT_UDP) += udp.o
obj-$(CONFIG_PROT_TCP) += tcp.o
obj-$(CONFIG_CMD_WGET) += wget.o
+obj-$(CONFIG_DHCP_CLIENTID) += dhcp-clientid.o
# Disable this warning as it is triggered by:
......@@ -184,7 +186,7 @@ index 0000000000..61e77c6f37
+#endif
+// This function is a "weak symbol": if it is defined anywhere else, that symbol will take precedence at link time
+// In practice we provide a sensible default implementation that users can override
+__weak void construct_dhcp_clientid(unsigned int hw_addr, unsigned int ipmb_addr, unsigned int site_number, unsigned int site_type, const char *shelf_addr) {
+__weak void construct_dhcp_clientid(unsigned int hw_addr, const char *ipmb_addr, unsigned int site_number, unsigned int site_type, const char *shelf_addr) {
+ char dhcp_clientid[3*(3+SIPL_SHELF_ADDR_MAXSIZE)];
+ // The string begins with site_type, site_number, ipmb_addr concatenated as hex
+ sprintf(dhcp_clientid, "%02X:%02X:%02X", site_type, site_number, ipmb_addr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment