diff mbox series

[PATCHv2] net: add support to parse the NIS domain for the dhcp options

Message ID 20240412204533.83605-1-ckhardin@gmail.com
State Accepted
Commit 8ab388bfdbcf1490c8c40480ef187a025b55c553
Delegated to: Tom Rini
Headers show
Series [PATCHv2] net: add support to parse the NIS domain for the dhcp options | expand

Commit Message

Charles Hardin April 12, 2024, 8:45 p.m. UTC
There is code in the bootp parsing for NIS domain and add the
same support for the dhcp options as well. This allows the same
usage of the data when the dhcp command is used in the boot
command.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
---
 net/bootp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Tom Rini April 19, 2024, 1:57 a.m. UTC | #1
On Fri, 12 Apr 2024 13:45:33 -0700, Charles Hardin wrote:

> There is code in the bootp parsing for NIS domain and add the
> same support for the dhcp options as well. This allows the same
> usage of the data when the dhcp command is used in the boot
> command.
> 
> 

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/net/bootp.c b/net/bootp.c
index 6800290963..c15472f5d3 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -883,6 +883,14 @@  static void dhcp_process_options(uchar *popt, uchar *end)
 			break;
 		case 28:	/* Ignore Broadcast Address Option */
 			break;
+		case 40:	/* NIS Domain name */
+			if (net_nis_domain[0] == 0) {
+				size = truncate_sz("NIS Domain Name",
+					sizeof(net_nis_domain), size);
+				memcpy(&net_nis_domain, popt + 2, size);
+				net_nis_domain[size] = 0;
+			}
+			break;
 #if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
 		case 42:	/* NTP server IP */
 			net_copy_ip(&net_ntp_server, (popt + 2));