net: Increase the size of the net_boot_file_name buffer
PATCH 1/1 net: Increase the size of the net_boot_file_name buffer
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.
--- include/net.h | 2 +- net/net.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/net.h +1 -1
@@ -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 */
net/net.c +1 -1
@@ -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 */
Signature · 1 line
1.9.1
PATCH 1/1 net: Increase the size of the net_boot_file_name buffer
Dear Jacob,
Quoted 5 lines · In message <[email protected]> you wrote:
The
net_boot_file_namebuffer 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
Signature · 5 lines
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_PATCH 1/1 net: Increase the size of the net_boot_file_name buffer
Quoted 10 lines · Wolfgang Denk
Dear Jacob,
Quoted 5 lines · In message <[email protected]> you wrote:
The
net_boot_file_namebuffer 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
Quoted 4 lines
Best regards,
Wolfgang Denk
PATCH 1/1 net: Increase the size of the net_boot_file_name buffer
Dear Jacob,
Quoted 6 lines · In message <[email protected]> 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.
Quoted 6 lines
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
Signature · 5 lines
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.
PATCH 1/1 net: Increase the size of the net_boot_file_name buffer
Quoted 10 lines · Wolfgang Denk
Dear Jacob,
Quoted 5 lines · In message <[email protected]> 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.
Quoted 7 lines
Quoted 6 lines
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
Quoted 4 lines
Best regards,
Wolfgang Denk
PATCH 1/1 net: Increase the size of the net_boot_file_name buffer
Quoted 18 lines
Quoted 16 lines · Stefan Bruens
Quoted 11 lines · On Thursday 01 October 2015 16:27:11 Wolfgang Denk wrote:
Dear Jacob,
Quoted 5 lines · In message <[email protected]> you wrote:
The
net_boot_file_namebuffer 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).
Quoted 6 lines
Quoted 2 lines
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.
PATCH 1/1 net: Increase the size of the net_boot_file_name buffer
In reply to Wolfgang DenkQuoted 11 lines · On Thursday 01 October 2015 16:27:11 Wolfgang Denk wrote:
Dear Jacob,
Quoted 5 lines · In message <[email protected]> you wrote:
The
net_boot_file_namebuffer 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
Signature · 3 lines
Stefan Br?ns / Bergstra?e 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019 work: +49 2405 49936-424
PATCH 1/1 net: Increase the size of the net_boot_file_name buffer
Quoted 10 lines · Stefan Bruens
Quoted 9 lines · On Thursday 01 October 2015 16:27:11 Wolfgang Denk wrote:
Dear Jacob,
Quoted 5 lines · In message <[email protected]> you wrote:
The
net_boot_file_namebuffer 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.
Quoted 8 lines
Quoted 2 lines
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.
Signature · 3 lines
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
PATCH 1/1 net: Increase the size of the net_boot_file_name buffer
In reply to Jacob StifflerHi Jacob,
Quoted 7 lines · Jacob Stiffler
The
net_boot_file_namebuffer 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 <[email protected]>
PATCH 1/1 net: Increase the size of the net_boot_file_name buffer
In reply to Jacob StifflerQuoted 7 lines · Jacob Stiffler
The
net_boot_file_namebuffer 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 <[email protected]>
Applied to u-boot-net/master, thanks!
-Joe