u-boot/net
Sébastien Szymanski d2986567b2 net: nfs: fix file handle length in NFSv3
The NFS protocol uses file handles to refer to file or directory.
In NFSv2 file handles have a fixed size of 32 bytes.
In NFSv3 file handles have a variable length up to 64 bytes. This is
also true for the MOUNT protocol. [1]
When the NFSv3 server replies with a file handle length > 32 bytes, U-Boot
only copies 32 bytes of that file handle and the next LOOKUP Call fails:

BIOS> nfs ${loadaddr} 192.168.1.51:/nfsroot/opos93dev-br/boot/Image
Using ethernet@428a0000 device
File transfer via NFS from server 192.168.1.51; our IP address is 192.168.1.133
Filename '/nfsroot/opos93dev-br/boot/Image'.
Load address: 0x80400000
Loading: *** ERROR: File lookup fail

done
BIOS>

Looking at this transfer in Wireshark, we can see that the server
replies with the following file handle:

    length: 36
    [hash (CRC-32): 0x230ac67b]
    FileHandle: 0100070101005e000000000091763911f87c449fa73c298552db19ba0c9f60002980cfd2

and U-Boot sends the following file handle in the next LOOKUP Call:

    length: 32
    [hash (CRC-32): 0x6314131b]
    FileHandle: 000000240100070101005e000000000091763911f87c449fa73c298552db19ba

Fix this by using a variable length file handle for dirfh.

[1] https://www.rfc-editor.org/rfc/rfc1813.html#page-106

Fixes: b0baca9820 ("net: NFS: Add NFSv3 support")
Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Tested-by: Andrew Davis <afd@ti.com>
2024-04-10 09:34:53 -06:00
..
arp.c Convert CONFIG_NET_RETRY_COUNT to Kconfig 2022-03-18 12:48:17 -04:00
arp.h global: Drop common.h inclusion 2023-12-21 08:54:37 -05:00
bootp.c net: Get pxe config file from dhcp option 209 2023-11-05 13:28:40 -05:00
bootp.h net: bootp: Move port numbers to header 2023-10-17 20:50:52 -04:00
cdp.c Remove #include <timestamp.h> from files which do not need it 2021-09-17 12:10:44 -04:00
cdp.h SPDX: Convert a few files that were missed before 2018-05-10 20:38:35 -04:00
dhcpv6.c net: dhcp6: Fix OPT_BOOTFILE_PARAM parsing 2023-11-05 13:28:40 -05:00
dhcpv6.h net: dhcp6: Fix VCI string 2023-06-14 15:48:45 -04:00
dns.c net: move random_port() to dns 2020-06-12 13:17:23 -04:00
dns.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dsa-uclass.c net: dsa: Fix OF fallback lookup for ports 2023-06-14 18:38:25 +08:00
eth_bootdev.c bootstd: Use bootdev instead of bootdevice 2023-07-16 23:13:17 +08:00
eth_common.c net: phy: Remove unused NEEDS_MANUAL_RELOC code bits 2023-09-14 10:42:25 -04:00
eth_internal.h net: Remove eth_legacy.c 2022-12-07 16:04:17 -05:00
eth-uclass.c net: eth-uclass: Improve error message when MAC is not found 2023-11-05 16:11:38 -05:00
fastboot_tcp.c net: share fastboot boot handle logic between transports 2023-05-05 17:48:44 -04:00
fastboot_udp.c fastboot: multiresponse support 2024-01-09 14:58:33 +01:00
Kconfig Prepare v2024.01-rc6 2024-01-03 09:22:47 -05:00
link_local.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
link_local.h global: Drop common.h inclusion 2023-12-21 08:54:37 -05:00
Makefile net: Fix compiling SPL when fastboot is enabled 2023-10-17 20:50:52 -04:00
mdio-mux-uclass.c treewide: use dm_mdio_read/write/reset() wrappers 2022-04-10 08:44:12 +03:00
mdio-uclass.c net: mdio-uclass: Bind and probe generic Ethernet PHY driver 2024-03-26 19:58:26 -04:00
ndisc.c net: ipv6: router advertisement message length should be within limits 2023-07-27 13:39:07 -04:00
net_rand.h global: Drop common.h inclusion 2023-12-21 08:54:37 -05:00
net.c net: Add option for tracing packets 2023-11-05 16:11:38 -05:00
net6.c net: ipv6: Add support for default gateway discovery. 2023-05-05 17:58:52 -04:00
nfs.c net: nfs: fix file handle length in NFSv3 2024-04-10 09:34:53 -06:00
nfs.h net: nfs: remove superfluous packed attribute 2019-09-04 11:37:19 -05:00
pcap.c net: introduce packet capture support 2019-09-04 11:37:19 -05:00
ping.c net: Do not respond to ICMP_ECHO_REQUEST if we do not have an IP address 2021-01-19 09:15:02 -05:00
ping.h global: Drop common.h inclusion 2023-12-21 08:54:37 -05:00
ping6.c net: ping6: Add ping6 command 2022-12-05 12:47:16 -05:00
rarp.c Convert CONFIG_NET_RETRY_COUNT to Kconfig 2022-03-18 12:48:17 -04:00
rarp.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sntp.c net: sntp: remove CONFIG_TIMESTAMP constraint 2020-12-01 14:12:28 -05:00
tcp.c net: support being a TCP server to unblock TCP fastboot 2023-05-05 17:48:44 -04:00
tftp.c net: tftp: remove explicit efi configuration dependency 2024-01-17 08:40:25 +01:00
udp.c net: add a generic udp protocol 2020-09-30 16:55:03 -04:00
wget.c Prepare v2024.01-rc6 2024-01-03 09:22:47 -05:00
wol.c env: Drop environment.h header file where not needed 2019-08-11 16:43:41 -04:00
wol.h net: Add new wol command - Wake on LAN 2018-07-02 14:14:20 -05:00