* [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer
@ 2015-09-30 14:12 Jacob Stiffler
2015-10-01 14:27 ` Wolfgang Denk
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Jacob Stiffler @ 2015-09-30 14:12 UTC (permalink / raw)
To: u-boot
The net_boot_file_name buffer is used as storage for the bootfilename
command line argument to network boot commands such as tftp and nfs.
Increase the size of this buffer to 1024 bytes as the current size of
128 bytes is restrictive for arbitrary paths on the server.
Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
---
include/net.h | 2 +-
net/net.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net.h b/include/net.h
index f1671e3..197d2c6 100644
--- a/include/net.h
+++ b/include/net.h
@@ -512,7 +512,7 @@ enum proto_t {
TFTPSRV, TFTPPUT, LINKLOCAL
};
-extern char net_boot_file_name[128];/* Boot File name */
+extern char net_boot_file_name[1024];/* Boot File name */
/* The actual transferred size of the bootfile (in bytes) */
extern u32 net_boot_file_size;
/* Boot file size in blocks as reported by the DHCP server */
diff --git a/net/net.c b/net/net.c
index a115ce2..7116ef3 100644
--- a/net/net.c
+++ b/net/net.c
@@ -164,7 +164,7 @@ ushort net_our_vlan = 0xFFFF;
ushort net_native_vlan = 0xFFFF;
/* Boot File name */
-char net_boot_file_name[128];
+char net_boot_file_name[1024];
/* The actual transferred size of the bootfile (in bytes) */
u32 net_boot_file_size;
/* Boot file size in blocks as reported by the DHCP server */
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer
2015-09-30 14:12 [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer Jacob Stiffler
@ 2015-10-01 14:27 ` Wolfgang Denk
2015-10-01 17:31 ` Jacob Stiffler
2015-10-03 14:13 ` Stefan Bruens
2015-10-28 20:09 ` Joe Hershberger
2015-10-29 19:33 ` Joe Hershberger
2 siblings, 2 replies; 10+ messages in thread
From: Wolfgang Denk @ 2015-10-01 14:27 UTC (permalink / raw)
To: u-boot
Dear Jacob,
In message <1443622325-30792-1-git-send-email-j-stiffler@ti.com> you wrote:
> The net_boot_file_name buffer is used as storage for the bootfilename
> command line argument to network boot commands such as tftp and nfs.
>
> Increase the size of this buffer to 1024 bytes as the current size of
> 128 bytes is restrictive for arbitrary paths on the server.
According to RFC 2131, the boot file name has a fixed size of 128
octets.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Drun'? 'm not drun'! You woudn' dare call m' drun' if I was sober!
- Terry Pratchett, _Men at Arms_
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer
2015-10-01 14:27 ` Wolfgang Denk
@ 2015-10-01 17:31 ` Jacob Stiffler
2015-10-01 20:07 ` Wolfgang Denk
2015-10-03 14:13 ` Stefan Bruens
1 sibling, 1 reply; 10+ messages in thread
From: Jacob Stiffler @ 2015-10-01 17:31 UTC (permalink / raw)
To: u-boot
On 10/1/2015 10:27 AM, Wolfgang Denk wrote:
> Dear Jacob,
>
> In message <1443622325-30792-1-git-send-email-j-stiffler@ti.com> you wrote:
>> The net_boot_file_name buffer is used as storage for the bootfilename
>> command line argument to network boot commands such as tftp and nfs.
>>
>> Increase the size of this buffer to 1024 bytes as the current size of
>> 128 bytes is restrictive for arbitrary paths on the server.
> According to RFC 2131, the boot file name has a fixed size of 128
> octets.
Wolfgang,
Yes. However, the global "net_boot_file_name" is not only used for
BOOTP, but also for NFS and TFTP.
"net_boot_file_name" appears to be temporary storage to supply the file
path to arbitrary protocols from the command line arguments.
The "file" field in the bootp message is fixed at 128 octets in the
"bootp_hdr" structure.
The contents of "net_boot_file_name" are read or written using the
standard "strncopy()" or the similar "copy_filename()", so there should
be any issue with respect to memory leaks.
Thank you,
Jacob Stiffler
> Best regards,
>
> Wolfgang Denk
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer
2015-10-01 17:31 ` Jacob Stiffler
@ 2015-10-01 20:07 ` Wolfgang Denk
2015-10-01 20:11 ` Jacob Stiffler
0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Denk @ 2015-10-01 20:07 UTC (permalink / raw)
To: u-boot
Dear Jacob,
In message <560D6DE3.8070901@ti.com> you wrote:
>
> Yes. However, the global "net_boot_file_name" is not only used for
> BOOTP, but also for NFS and TFTP.
>
> "net_boot_file_name" appears to be temporary storage to supply the file
> path to arbitrary protocols from the command line arguments.
I see.
> The "file" field in the bootp message is fixed at 128 octets in the
> "bootp_hdr" structure.
>
> The contents of "net_boot_file_name" are read or written using the
> standard "strncopy()" or the similar "copy_filename()", so there should
> be any issue with respect to memory leaks.
I guess you mean there should NOT be any issue?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Anarchy may not be the best form of government, but it's better than
no government at all.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer
2015-10-01 20:07 ` Wolfgang Denk
@ 2015-10-01 20:11 ` Jacob Stiffler
2015-10-06 17:26 ` Jacob Stiffler
0 siblings, 1 reply; 10+ messages in thread
From: Jacob Stiffler @ 2015-10-01 20:11 UTC (permalink / raw)
To: u-boot
On 10/1/2015 4:07 PM, Wolfgang Denk wrote:
> Dear Jacob,
>
> In message <560D6DE3.8070901@ti.com> you wrote:
>> Yes. However, the global "net_boot_file_name" is not only used for
>> BOOTP, but also for NFS and TFTP.
>>
>> "net_boot_file_name" appears to be temporary storage to supply the file
>> path to arbitrary protocols from the command line arguments.
> I see.
>
>> The "file" field in the bootp message is fixed at 128 octets in the
>> "bootp_hdr" structure.
>>
>> The contents of "net_boot_file_name" are read or written using the
>> standard "strncopy()" or the similar "copy_filename()", so there should
>> be any issue with respect to memory leaks.
> I guess you mean there should NOT be any issue?
Yes, sorry. There should not be any issue with respect to memory leaks.
Thank you,
Jacob Stiffler
> Best regards,
>
> Wolfgang Denk
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer
2015-10-01 14:27 ` Wolfgang Denk
2015-10-01 17:31 ` Jacob Stiffler
@ 2015-10-03 14:13 ` Stefan Bruens
2015-10-03 14:41 ` Otavio Salvador
1 sibling, 1 reply; 10+ messages in thread
From: Stefan Bruens @ 2015-10-03 14:13 UTC (permalink / raw)
To: u-boot
On Thursday 01 October 2015 16:27:11 Wolfgang Denk wrote:
> Dear Jacob,
>
> In message <1443622325-30792-1-git-send-email-j-stiffler@ti.com> you wrote:
> > The net_boot_file_name buffer is used as storage for the bootfilename
> > command line argument to network boot commands such as tftp and nfs.
> >
> > Increase the size of this buffer to 1024 bytes as the current size of
> > 128 bytes is restrictive for arbitrary paths on the server.
>
> According to RFC 2131, the boot file name has a fixed size of 128
> octets.
You can also put the file name into Option 67, which results in a length limit
of 255 octets (DHCP option length limit).
I sent patches with several DHCP enhancements, including Option 67 support, to
the ML a few weeks ago.
Kind regards,
Stefan
--
Stefan Br?ns / Bergstra?e 21 / 52062 Aachen
home: +49 241 53809034 mobile: +49 151 50412019
work: +49 2405 49936-424
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer
2015-10-03 14:13 ` Stefan Bruens
@ 2015-10-03 14:41 ` Otavio Salvador
0 siblings, 0 replies; 10+ messages in thread
From: Otavio Salvador @ 2015-10-03 14:41 UTC (permalink / raw)
To: u-boot
On Sat, Oct 3, 2015 at 11:13 AM, Stefan Bruens
<stefan.bruens@rwth-aachen.de> wrote:
> On Thursday 01 October 2015 16:27:11 Wolfgang Denk wrote:
>> Dear Jacob,
>>
>> In message <1443622325-30792-1-git-send-email-j-stiffler@ti.com> you wrote:
>> > The net_boot_file_name buffer is used as storage for the bootfilename
>> > command line argument to network boot commands such as tftp and nfs.
>> >
>> > Increase the size of this buffer to 1024 bytes as the current size of
>> > 128 bytes is restrictive for arbitrary paths on the server.
>>
>> According to RFC 2131, the boot file name has a fixed size of 128
>> octets.
>
> You can also put the file name into Option 67, which results in a length limit
> of 255 octets (DHCP option length limit).
>
> I sent patches with several DHCP enhancements, including Option 67 support, to
> the ML a few weeks ago.
Has those patches been applied? otherwise it would be good to rebase
it and send them again as we are close of release and merge window
will soon open.
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer
2015-10-01 20:11 ` Jacob Stiffler
@ 2015-10-06 17:26 ` Jacob Stiffler
0 siblings, 0 replies; 10+ messages in thread
From: Jacob Stiffler @ 2015-10-06 17:26 UTC (permalink / raw)
To: u-boot
> On Sat, Oct 3, 2015 at 11:13 AM, Stefan Bruens
> <stefan.bruens@rwth-aachen.de> wrote:
> > On Thursday 01 October 2015 16:27:11 Wolfgang Denk wrote:
> >> Dear Jacob,
> >>
> >> In message <1443622325-30792-1-git-send-email-j-stiffler@ti.com> you wrote:
> >> > The net_boot_file_name buffer is used as storage for the bootfilename
> >> > command line argument to network boot commands such as tftp and nfs.
> >> >
> >> > Increase the size of this buffer to 1024 bytes as the current size of
> >> > 128 bytes is restrictive for arbitrary paths on the server.
> >>
> >> According to RFC 2131, the boot file name has a fixed size of 128
> >> octets.
> >
> > You can also put the file name into Option 67, which results in a length limit
> > of 255 octets (DHCP option length limit).
> >
> > I sent patches with several DHCP enhancements, including Option 67 support, to
> > the ML a few weeks ago.
>
> Has those patches been applied? otherwise it would be good to rebase
> it and send them again as we are close of release and merge window
> will soon open.
The intent of this patch is not to increase the size of the path for bootp, but to
increase the size of the path for nfs and tftp. The "net_boot_file_name" is a common
global variable used for all network commands which load files into memory, and is
basically temporary storage.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer
2015-09-30 14:12 [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer Jacob Stiffler
2015-10-01 14:27 ` Wolfgang Denk
@ 2015-10-28 20:09 ` Joe Hershberger
2015-10-29 19:33 ` Joe Hershberger
2 siblings, 0 replies; 10+ messages in thread
From: Joe Hershberger @ 2015-10-28 20:09 UTC (permalink / raw)
To: u-boot
Hi Jacob,
On Wed, Sep 30, 2015 at 9:12 AM, Jacob Stiffler <j-stiffler@ti.com> wrote:
> The net_boot_file_name buffer is used as storage for the bootfilename
> command line argument to network boot commands such as tftp and nfs.
>
> Increase the size of this buffer to 1024 bytes as the current size of
> 128 bytes is restrictive for arbitrary paths on the server.
>
> Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer
2015-09-30 14:12 [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer Jacob Stiffler
2015-10-01 14:27 ` Wolfgang Denk
2015-10-28 20:09 ` Joe Hershberger
@ 2015-10-29 19:33 ` Joe Hershberger
2 siblings, 0 replies; 10+ messages in thread
From: Joe Hershberger @ 2015-10-29 19:33 UTC (permalink / raw)
To: u-boot
On Wed, Sep 30, 2015 at 9:12 AM, Jacob Stiffler <j-stiffler@ti.com> wrote:
> The net_boot_file_name buffer is used as storage for the bootfilename
> command line argument to network boot commands such as tftp and nfs.
>
> Increase the size of this buffer to 1024 bytes as the current size of
> 128 bytes is restrictive for arbitrary paths on the server.
>
> Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
Applied to u-boot-net/master, thanks!
-Joe
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-10-29 19:33 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-30 14:12 [U-Boot] [PATCH] net: Increase the size of the net_boot_file_name buffer Jacob Stiffler
2015-10-01 14:27 ` Wolfgang Denk
2015-10-01 17:31 ` Jacob Stiffler
2015-10-01 20:07 ` Wolfgang Denk
2015-10-01 20:11 ` Jacob Stiffler
2015-10-06 17:26 ` Jacob Stiffler
2015-10-03 14:13 ` Stefan Bruens
2015-10-03 14:41 ` Otavio Salvador
2015-10-28 20:09 ` Joe Hershberger
2015-10-29 19:33 ` Joe Hershberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox