* [PATCH 1/1] net: add support to parse the NIS domain for the dhcp options
@ 2024-04-01 19:13 Charles Hardin
2024-04-12 19:58 ` Tom Rini
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Charles Hardin @ 2024-04-01 19:13 UTC (permalink / raw)
To: u-boot; +Cc: joe.hershberger, rfried.dev, ckhardin
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(+)
diff --git a/net/bootp.c b/net/bootp.c
index 6800290963..046caf3685 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, ext + 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));
--
2.39.3 (Apple Git-146)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] net: add support to parse the NIS domain for the dhcp options
2024-04-01 19:13 [PATCH 1/1] net: add support to parse the NIS domain for the dhcp options Charles Hardin
@ 2024-04-12 19:58 ` Tom Rini
2024-04-12 20:45 ` [PATCHv2] " Charles Hardin
2024-04-12 21:59 ` [PATCH 1/1] " Tom Rini
2 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2024-04-12 19:58 UTC (permalink / raw)
To: Charles Hardin; +Cc: u-boot, joe.hershberger, rfried.dev
[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]
On Mon, Apr 01, 2024 at 12:13:19PM -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.
>
> Signed-off-by: Charles Hardin <ckhardin@gmail.com>
> ---
> net/bootp.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/net/bootp.c b/net/bootp.c
> index 6800290963..046caf3685 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, ext + 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));
This fails to build:
net/bootp.c: In function 'dhcp_process_options':
net/bootp.c:890:57: error: 'ext' undeclared (first use in this function)
890 | memcpy(&net_nis_domain, ext + 2, size);
| ^~~
net/bootp.c:890:57: note: each undeclared identifier is reported only once for each function it appears in
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCHv2] net: add support to parse the NIS domain for the dhcp options
2024-04-01 19:13 [PATCH 1/1] net: add support to parse the NIS domain for the dhcp options Charles Hardin
2024-04-12 19:58 ` Tom Rini
@ 2024-04-12 20:45 ` Charles Hardin
2024-04-19 1:57 ` Tom Rini
2024-04-12 21:59 ` [PATCH 1/1] " Tom Rini
2 siblings, 1 reply; 5+ messages in thread
From: Charles Hardin @ 2024-04-12 20:45 UTC (permalink / raw)
To: u-boot; +Cc: joe.hershberger, rfried.dev, Charles Hardin
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(+)
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));
--
2.39.3 (Apple Git-146)
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] net: add support to parse the NIS domain for the dhcp options
2024-04-01 19:13 [PATCH 1/1] net: add support to parse the NIS domain for the dhcp options Charles Hardin
2024-04-12 19:58 ` Tom Rini
2024-04-12 20:45 ` [PATCHv2] " Charles Hardin
@ 2024-04-12 21:59 ` Tom Rini
2 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2024-04-12 21:59 UTC (permalink / raw)
To: u-boot, Charles Hardin; +Cc: joe.hershberger, rfried.dev
On Mon, 01 Apr 2024 12:13:19 -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!
--
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCHv2] net: add support to parse the NIS domain for the dhcp options
2024-04-12 20:45 ` [PATCHv2] " Charles Hardin
@ 2024-04-19 1:57 ` Tom Rini
0 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2024-04-19 1:57 UTC (permalink / raw)
To: u-boot, Charles Hardin; +Cc: joe.hershberger, rfried.dev
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!
--
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-04-19 1:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-01 19:13 [PATCH 1/1] net: add support to parse the NIS domain for the dhcp options Charles Hardin
2024-04-12 19:58 ` Tom Rini
2024-04-12 20:45 ` [PATCHv2] " Charles Hardin
2024-04-19 1:57 ` Tom Rini
2024-04-12 21:59 ` [PATCH 1/1] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox