* [PATCH] Allow colon in PXE bootfile URLs
@ 2021-08-15 11:43 Lyle Franklin
2021-09-14 9:13 ` Ramon Fried
0 siblings, 1 reply; 7+ messages in thread
From: Lyle Franklin @ 2021-08-15 11:43 UTC (permalink / raw)
To: u-boot; +Cc: Joe Hershberger
From: Lyle Franklin <lylejfranklin@gmail.com>
Date: Sun, 15 Aug 2021 07:17:14 -0400
Subject: [PATCH] Allow colon in PXE bootfile URLs
- U-boot's PXE flow supports prefixing your bootfile name with an
IP address to fetch from a server other than the DHCP server,
e.g. `hostIPaddr:bootfilename`:
https://github.com/u-boot/u-boot/commit/a93907c43f847f076dd0e34ee3b69b5e8e6d0d29
- However, this breaks bootfile paths which contain a colon, e.g.
`f0:ad:4e:10:1b:87/7/pxelinux.cfg/default`
- This patch checks whether the `hostIPaddr` prefix is a valid
IP address before overriding the serverIP otherwise the whole
bootfile path is preserved
Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>
---
net/net.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/net.c b/net/net.c
index c2992a0908..30fc0a29d7 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1540,14 +1540,18 @@ int is_serverip_in_cmd(void)
int net_parse_bootfile(struct in_addr *ipaddr, char *filename, int max_len)
{
char *colon;
+ struct in_addr ip;
if (net_boot_file_name[0] == '\0')
return 0;
colon = strchr(net_boot_file_name, ':');
if (colon) {
- if (ipaddr)
- *ipaddr = string_to_ip(net_boot_file_name);
+ ip = string_to_ip(net_boot_file_name);
+ if (ipaddr && ip.s_addr)
+ *ipaddr = ip;
+ }
+ if (ip.s_addr) {
strncpy(filename, colon + 1, max_len);
} else {
strncpy(filename, net_boot_file_name, max_len);
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Allow colon in PXE bootfile URLs
2021-08-15 11:43 [PATCH] Allow colon in PXE bootfile URLs Lyle Franklin
@ 2021-09-14 9:13 ` Ramon Fried
2021-09-14 9:18 ` Ramon Fried
0 siblings, 1 reply; 7+ messages in thread
From: Ramon Fried @ 2021-09-14 9:13 UTC (permalink / raw)
To: Lyle Franklin; +Cc: U-Boot Mailing List, Joe Hershberger
On Sun, Aug 15, 2021 at 5:09 PM Lyle Franklin <lylejfranklin@gmail.com> wrote:
>
> From: Lyle Franklin <lylejfranklin@gmail.com>
> Date: Sun, 15 Aug 2021 07:17:14 -0400
> Subject: [PATCH] Allow colon in PXE bootfile URLs
>
> - U-boot's PXE flow supports prefixing your bootfile name with an
> IP address to fetch from a server other than the DHCP server,
> e.g. `hostIPaddr:bootfilename`:
>
> https://github.com/u-boot/u-boot/commit/a93907c43f847f076dd0e34ee3b69b5e8e6d0d29
> - However, this breaks bootfile paths which contain a colon, e.g.
> `f0:ad:4e:10:1b:87/7/pxelinux.cfg/default`
> - This patch checks whether the `hostIPaddr` prefix is a valid
> IP address before overriding the serverIP otherwise the whole
> bootfile path is preserved
>
> Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>
> ---
> net/net.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/net/net.c b/net/net.c
> index c2992a0908..30fc0a29d7 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -1540,14 +1540,18 @@ int is_serverip_in_cmd(void)
> int net_parse_bootfile(struct in_addr *ipaddr, char *filename, int max_len)
> {
> char *colon;
> + struct in_addr ip;
>
> if (net_boot_file_name[0] == '\0')
> return 0;
>
> colon = strchr(net_boot_file_name, ':');
> if (colon) {
> - if (ipaddr)
> - *ipaddr = string_to_ip(net_boot_file_name);
> + ip = string_to_ip(net_boot_file_name);
> + if (ipaddr && ip.s_addr)
> + *ipaddr = ip;
> + }
> + if (ip.s_addr) {
> strncpy(filename, colon + 1, max_len);
> } else {
> strncpy(filename, net_boot_file_name, max_len);
> --
> 2.31.1
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Allow colon in PXE bootfile URLs
2021-09-14 9:13 ` Ramon Fried
@ 2021-09-14 9:18 ` Ramon Fried
2022-01-22 15:16 ` [PATCH v2] " Lyle Franklin
0 siblings, 1 reply; 7+ messages in thread
From: Ramon Fried @ 2021-09-14 9:18 UTC (permalink / raw)
To: Lyle Franklin; +Cc: U-Boot Mailing List, Joe Hershberger
On Tue, Sep 14, 2021 at 12:13 PM Ramon Fried <rfried.dev@gmail.com> wrote:
>
> On Sun, Aug 15, 2021 at 5:09 PM Lyle Franklin <lylejfranklin@gmail.com> wrote:
> >
> > From: Lyle Franklin <lylejfranklin@gmail.com>
> > Date: Sun, 15 Aug 2021 07:17:14 -0400
> > Subject: [PATCH] Allow colon in PXE bootfile URLs
> >
> > - U-boot's PXE flow supports prefixing your bootfile name with an
> > IP address to fetch from a server other than the DHCP server,
> > e.g. `hostIPaddr:bootfilename`:
> >
> > https://github.com/u-boot/u-boot/commit/a93907c43f847f076dd0e34ee3b69b5e8e6d0d29
> > - However, this breaks bootfile paths which contain a colon, e.g.
> > `f0:ad:4e:10:1b:87/7/pxelinux.cfg/default`
> > - This patch checks whether the `hostIPaddr` prefix is a valid
> > IP address before overriding the serverIP otherwise the whole
> > bootfile path is preserved
> >
> > Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>
> > ---
> > net/net.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/net.c b/net/net.c
> > index c2992a0908..30fc0a29d7 100644
> > --- a/net/net.c
> > +++ b/net/net.c
> > @@ -1540,14 +1540,18 @@ int is_serverip_in_cmd(void)
> > int net_parse_bootfile(struct in_addr *ipaddr, char *filename, int max_len)
> > {
> > char *colon;
> > + struct in_addr ip;
> >
> > if (net_boot_file_name[0] == '\0')
> > return 0;
> >
> > colon = strchr(net_boot_file_name, ':');
> > if (colon) {
> > - if (ipaddr)
> > - *ipaddr = string_to_ip(net_boot_file_name);
> > + ip = string_to_ip(net_boot_file_name);
> > + if (ipaddr && ip.s_addr)
> > + *ipaddr = ip;
> > + }
> > + if (ip.s_addr) {
> > strncpy(filename, colon + 1, max_len);
> > } else {
> > strncpy(filename, net_boot_file_name, max_len);
> > --
> > 2.31.1
> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Patch doesn't apply, please rebase and resend.
Additionally, it looks like there is wrong indentation, please check
patch with checkpatch before resubmitting
Thanks,
Ramon
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] Allow colon in PXE bootfile URLs
2021-09-14 9:18 ` Ramon Fried
@ 2022-01-22 15:16 ` Lyle Franklin
2022-04-10 5:30 ` Ramon Fried
0 siblings, 1 reply; 7+ messages in thread
From: Lyle Franklin @ 2022-01-22 15:16 UTC (permalink / raw)
To: rfried.dev; +Cc: u-boot, joe.hershberger, Lyle Franklin
- U-boot's PXE flow supports prefixing your bootfile name with an
IP address to fetch from a server other than the DHCP server,
e.g. `hostIPaddr:bootfilename`:
https://github.com/u-boot/u-boot/commit/a93907c43f847f076dd0e34ee3b69b5e8e6d0d29
- However, this breaks bootfile paths which contain a colon, e.g.
`f0:ad:4e:10:1b:87/7/pxelinux.cfg/default`
- This patch checks whether the `hostIPaddr` prefix is a valid
IP address before overriding the serverIP otherwise the whole
bootfile path is preserved
Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>
---
net/net.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/net.c b/net/net.c
index 072a82d8f9..57ed77795a 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1538,14 +1538,18 @@ int is_serverip_in_cmd(void)
int net_parse_bootfile(struct in_addr *ipaddr, char *filename, int max_len)
{
char *colon;
+ struct in_addr ip;
if (net_boot_file_name[0] == '\0')
return 0;
colon = strchr(net_boot_file_name, ':');
if (colon) {
- if (ipaddr)
- *ipaddr = string_to_ip(net_boot_file_name);
+ ip = string_to_ip(net_boot_file_name);
+ if (ipaddr && ip.s_addr)
+ *ipaddr = ip;
+ }
+ if (ip.s_addr) {
strncpy(filename, colon + 1, max_len);
} else {
strncpy(filename, net_boot_file_name, max_len);
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] Allow colon in PXE bootfile URLs
2022-01-22 15:16 ` [PATCH v2] " Lyle Franklin
@ 2022-04-10 5:30 ` Ramon Fried
2022-04-16 15:36 ` [PATCH v3] " Lyle Franklin
0 siblings, 1 reply; 7+ messages in thread
From: Ramon Fried @ 2022-04-10 5:30 UTC (permalink / raw)
To: Lyle Franklin; +Cc: U-Boot Mailing List, Joe Hershberger
On Sat, Jan 22, 2022 at 5:16 PM Lyle Franklin <lylejfranklin@gmail.com> wrote:
>
> - U-boot's PXE flow supports prefixing your bootfile name with an
> IP address to fetch from a server other than the DHCP server,
> e.g. `hostIPaddr:bootfilename`:
> https://github.com/u-boot/u-boot/commit/a93907c43f847f076dd0e34ee3b69b5e8e6d0d29
> - However, this breaks bootfile paths which contain a colon, e.g.
> `f0:ad:4e:10:1b:87/7/pxelinux.cfg/default`
> - This patch checks whether the `hostIPaddr` prefix is a valid
> IP address before overriding the serverIP otherwise the whole
> bootfile path is preserved
>
> Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>
> ---
> net/net.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/net/net.c b/net/net.c
> index 072a82d8f9..57ed77795a 100644
> --- a/net/net.c
> +++ b/net/net.c
> @@ -1538,14 +1538,18 @@ int is_serverip_in_cmd(void)
> int net_parse_bootfile(struct in_addr *ipaddr, char *filename, int max_len)
> {
> char *colon;
> + struct in_addr ip;
>
> if (net_boot_file_name[0] == '\0')
> return 0;
>
> colon = strchr(net_boot_file_name, ':');
> if (colon) {
> - if (ipaddr)
> - *ipaddr = string_to_ip(net_boot_file_name);
> + ip = string_to_ip(net_boot_file_name);
> + if (ipaddr && ip.s_addr)
> + *ipaddr = ip;
> + }
> + if (ip.s_addr) {
> strncpy(filename, colon + 1, max_len);
> } else {
> strncpy(filename, net_boot_file_name, max_len);
> --
> 2.31.1
>
Applied to u-boot-net/next
Thanks,
Ramon
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3] Allow colon in PXE bootfile URLs
2022-04-10 5:30 ` Ramon Fried
@ 2022-04-16 15:36 ` Lyle Franklin
2022-04-23 12:09 ` Tom Rini
0 siblings, 1 reply; 7+ messages in thread
From: Lyle Franklin @ 2022-04-16 15:36 UTC (permalink / raw)
To: rfried.dev; +Cc: u-boot, joe.hershberger, Lyle Franklin
- U-boot's PXE flow supports prefixing your bootfile name with an
IP address to fetch from a server other than the DHCP server,
e.g. `hostIPaddr:bootfilename`:
https://github.com/u-boot/u-boot/commit/a93907c43f847f076dd0e34ee3b69b5e8e6d0d29
- However, this breaks bootfile paths which contain a colon, e.g.
`f0:ad:4e:10:1b:87/7/pxelinux.cfg/default`
- This patch checks whether the `hostIPaddr` prefix is a valid
IP address before overriding the serverIP otherwise the whole
bootfile path is preserved
Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>
---
net/net.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/net/net.c b/net/net.c
index 072a82d8f9..034a5d6e67 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1538,14 +1538,19 @@ int is_serverip_in_cmd(void)
int net_parse_bootfile(struct in_addr *ipaddr, char *filename, int max_len)
{
char *colon;
+ struct in_addr ip;
+ ip.s_addr = 0;
if (net_boot_file_name[0] == '\0')
return 0;
colon = strchr(net_boot_file_name, ':');
if (colon) {
- if (ipaddr)
- *ipaddr = string_to_ip(net_boot_file_name);
+ ip = string_to_ip(net_boot_file_name);
+ if (ipaddr && ip.s_addr)
+ *ipaddr = ip;
+ }
+ if (ip.s_addr) {
strncpy(filename, colon + 1, max_len);
} else {
strncpy(filename, net_boot_file_name, max_len);
--
2.35.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v3] Allow colon in PXE bootfile URLs
2022-04-16 15:36 ` [PATCH v3] " Lyle Franklin
@ 2022-04-23 12:09 ` Tom Rini
0 siblings, 0 replies; 7+ messages in thread
From: Tom Rini @ 2022-04-23 12:09 UTC (permalink / raw)
To: Lyle Franklin; +Cc: rfried.dev, u-boot, joe.hershberger
[-- Attachment #1: Type: text/plain, Size: 718 bytes --]
On Sat, Apr 16, 2022 at 11:36:43AM -0400, Lyle Franklin wrote:
> - U-boot's PXE flow supports prefixing your bootfile name with an
> IP address to fetch from a server other than the DHCP server,
> e.g. `hostIPaddr:bootfilename`:
> https://github.com/u-boot/u-boot/commit/a93907c43f847f076dd0e34ee3b69b5e8e6d0d29
> - However, this breaks bootfile paths which contain a colon, e.g.
> `f0:ad:4e:10:1b:87/7/pxelinux.cfg/default`
> - This patch checks whether the `hostIPaddr` prefix is a valid
> IP address before overriding the serverIP otherwise the whole
> bootfile path is preserved
>
> Signed-off-by: Lyle Franklin <lylejfranklin@gmail.com>
Applied to u-boot/master, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-04-23 12:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-15 11:43 [PATCH] Allow colon in PXE bootfile URLs Lyle Franklin
2021-09-14 9:13 ` Ramon Fried
2021-09-14 9:18 ` Ramon Fried
2022-01-22 15:16 ` [PATCH v2] " Lyle Franklin
2022-04-10 5:30 ` Ramon Fried
2022-04-16 15:36 ` [PATCH v3] " Lyle Franklin
2022-04-23 12:09 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.