summaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)Author
11 daysnet: lwip: tftp: update image_load_addr after successful transferPranav Sanwal
do_tftpb() parses the load address into a local variable laddr but never updates the global image_load_addr. Commands that rely on image_load_addr as their default address (e.g. 'bmp info') therefore operate on the wrong address when called without an explicit argument after tftpboot. Update image_load_addr to laddr only on a successful transfer, so that it accurately reflects where data was actually loaded. Fixes: 4d4d7838127e ("net: lwip: add TFTP support and tftpboot command") Signed-off-by: Pranav Sanwal <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
11 daysnet: bootp: Drop unused codeMarek Vasut
This code is surely unused and there are not even commented out references to the function name. Drop the code. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Heiko Schocher <[email protected]> Reviewed-by: Kory Maincent <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
11 daysnet: lwip: nfs: fix buffer overflow when using symlinksPranav Tilak
When resolving a symlink, nfs_path points into a heap allocated buffer which is just large enough to hold the original path with no extra space. If the symlink target name is longer than the original filename, the write goes beyond the end of the buffer corrupting heap memory. Fix this by ensuring nfs_path always points to a buffer large enough to accommodate the resolved symlink path. Fixes: 230cf3bc2776 ("net: lwip: nfs: Port the NFS code to work with lwIP") Signed-off-by: Pranav Tilak <[email protected]> Acked-by: Jerome Forissier <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2026-03-18Merge patch series "led: remove legacy API"Tom Rini
Quentin Schulz <[email protected]> says: This migrates the last user of the legacy LED API, IMX233-OLinuXino and net/bootp.c, to the modern LED framework. I do have concern about being able to use BOOTP in SPL? In which case, I should probably add an additional check on CONFIG_IS_ENABLED(LED) in addition to IS_ENABLED(CONFIG_LED_BOOT)? I haven't tested this as I do not own an IMX233-OLinuXino, so please give this a try if you own this device. Then, since there's no user left of this legacy API, it is entirely removed. Link: https://lore.kernel.org/r/[email protected]
2026-03-18led: migrate last legacy LED user (olinuxino+net) to modern LED frameworkQuentin Schulz
This migrates the last user of the legacy LED API, IMX233-OLinuXino, to the modern LED framework. The current implementation does the following: - lit the LED when booting, - turn off the LED the moment a BOOTP packet is received, The first step is easily reproduced by using the /options/u-boot/boot-led property to point at the LED. Unfortunately, the boot-led is only lit by U-Boot proper at the very end of the boot process, much later than currently. We can however force the LED on whenever the GPIO LED driver is bound by marking the LED as default-state = "on", and this happens slightly before board_init() is called. We then do not need /options/u-boot/boot-led property for that anymore. However, the second step relies on /options/u-boot/boot-led and CONFIG_LED_BOOT being set to reproduce the same behavior and requires us to migrate net/bootp.c to the modern LED framework at the same time to keep bisectability. I couldn't figure out how to map CONFIG_LED_STATUS_BIT=778 to an actual GPIO on the SoC but according to the schematics[1] only one LED is present. I couldn't also map the SoC pin number to an actual GPIO from the IMX23 manual, but there's already one GPIO LED specified in the Device Tree so my guess is all of those are one and the same. This was only build tested as I do not own this device. [1] https://github.com/OLIMEX/OLINUXINO/blob/master/HARDWARE/iMX233-OLinuXino-Mini/1.%20Latest%20hardware%20revision/iMX233-OLINUXINO-MINI%20hardware%20revision%20E/iMX233-OLINUXINO-MINI_Rev_E.pdf Signed-off-by: Quentin Schulz <[email protected]>
2026-02-17Merge patch series "treewide: Clean up usage of DECLARE_GLOBAL_DATA_PTR"Tom Rini
Peng Fan (OSS) <[email protected]> says: This patch set primarily removes unused DECLARE_GLOBAL_DATA_PTR instances. Many files declare DECLARE_GLOBAL_DATA_PTR and include asm/global_data.h even though gd is never used. In these cases, asm/global_data.h is effectively treated as a proxy header, which is not a good practice. Following the Include What You Use principle, files should include only the headers they actually depend on, rather than relying on global_data.h indirectly. This approach is also adopted in Linux kernel [1]. The first few patches are prepartion to avoid building break after remove the including of global_data.h. A script is for filtering the files: list=`find . -name "*.[ch]"` for source in ${list} do result=`sed -n '/DECLARE_GLOBAL_DATA_PTR/p' ${source}` if [ "${result}" == "DECLARE_GLOBAL_DATA_PTR;" ]; then echo "Found in ${source}" result=`sed -n '/\<gd\>/p' ${source}` result2=`sed -n '/\<gd_/p' ${source}` result3=`sed -n '/\<gd->/p' ${source}` if [ "${result}" == "" ] && [ "${result2}" == "" ] && [ "${result3}" == "" ];then echo "Cleanup ${source}" sed -i '/DECLARE_GLOBAL_DATA_PTR/{N;/\n[[:space:]]*$/d;s/.*\n//;}' ${source} sed -i '/DECLARE_GLOBAL_DATA_PTR/d' ${source} sed -i '/global_data.h/d' ${source} git add ${source} fi fi done [1] https://lpc.events/event/17/contributions/1620/attachments/1228/2520/Linux%20Kernel%20Header%20Optimization.pdf CI: https://github.com/u-boot/u-boot/pull/865 Link: https://lore.kernel.org/r/[email protected]
2026-02-17treewide: Clean up DECLARE_GLOBAL_DATA_PTR usagePeng Fan
Remove DECLARE_GLOBAL_DATA_PTR from files where gd is not used, and drop the unnecessary inclusion of asm/global_data.h. Headers should be included directly by the files that need them, rather than indirectly via global_data.h. Reviewed-by: Patrice Chotard <[email protected]> #STMicroelectronics boards and STM32MP1 ram test driver Tested-by: Anshul Dalal <[email protected]> #TI boards Acked-by: Yao Zi <[email protected]> #TH1520 Signed-off-by: Peng Fan <[email protected]>
2026-02-06net: lwip: wget: rework the '#' printingMarek Vasut
Currently, the LWIP wget command prints excessive amount of progress indicator '#' for very long file downloads, limit this to one line that scales according to transfer size. The HTTP server does report the size of the entire file in protocol headers, which are received before the actual data transfer. Cache this information and use it to adaptively print progress indicator '#' until it fills one entire line worth of '#', which indicates the transfer has completed. This way, long transfers don't print pages of '#', but every transfer will print exactly one line worth of '#'. The algorithm for '#' printing is the same as TFTP tsize one. Signed-off-by: Marek Vasut <[email protected]> Acked-by: Jerome Forissier <[email protected]>
2026-02-06net: lwip: tftp: add support of tsize option to clientMarek Vasut
The TFTP server can report the size of the entire file that is about to be received in the Transfer Size Option, this is described in RFC 2349. This functionality is optional and the server may not report tsize in case it is not supported. Always send tsize request to the server to query the transfer size, and in case the server does respond, cache that information locally in tftp_state.tsize, otherwise cache size 0. Introduce new function tftp_client_get_tsize() which returns the cached tftp_state.tsize so clients can determine the transfer size and use it. Update net/lwip/tftp.c to make use of tftp_client_get_tsize() and avoid excessive printing of '#' during TFTP transfers in case the transfer size is reported by the server. Submitted upstream: https://savannah.nongnu.org/patch/index.php?item_id=10557 Signed-off-by: Marek Vasut <[email protected]> Acked-by: Jerome Forissier <[email protected]>
2026-02-06net: tftp: Fix TFTP Transfer Size data typeYuya Hamamachi
The TFTP transfer size is unsigned integer, update the data type and print formating string accordingly to prevent an overflow in case the file size is longer than 2 GiB. TFTP transfer of a 3 GiB file, before (wrong) and after (right): Loading: ################################################# 16 EiB Loading: ################################################## 3 GiB Signed-off-by: Yuya Hamamachi <[email protected]> Signed-off-by: Marek Vasut <[email protected]>
2026-02-06net: Stop conflating return value with file size in net_loop()Yuya Hamamachi
The net_loop() currently conflates return value with file size at the end of successful transfer, in NETLOOP_SUCCESS state. The return type of net_loop() is int, which makes this practice workable for file sizes below 2 GiB, but anything above that will lead to overflow and bogus negative return value from net_loop(). The return file size is only used by a few sites in the code base, which can be easily fixed. Change the net_loop() return value to always be only a return code, in case of error the returned value is the error code, in case of successful transfer the value is 0 or 1 instead of 0 or net_boot_file_size . This surely always fits into a signed integer. By keeping the return code 0 or 1 in case of successful transfer, no conditionals which depended on the old behavior are broken, but all the sites had to be inspected and updated accordingly. Fix the few sites which depend on the file size by making them directly use the net_boot_file_size variable value. This variable is accessible to all of those sites already, because they all include net-common.h . Signed-off-by: Yuya Hamamachi <[email protected]> Signed-off-by: Marek Vasut <[email protected]>
2026-02-04net: lwip: nfs: Prefer nfsserverip over serverip when setJonas Karlman
Prefer use of a 'nfsserverip' env var before falling back to 'serverip' when using the nfs command. Similar to how the 'tftpserverip' env var is preferred over 'serverip' by the tftp command. This also updates the error message to closer match the error message used by the lwIP tftp command when a server ip is not set. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2026-02-04net: lwip: dhcp: Save DHCP siaddr field to tftpserverip env varJonas Karlman
The DHCP siaddr field contains the IP address of next server to use in bootstrap. Typically this will be the IP address of a TFTP server or the IP address of the DHCP server itself. RFC 2131, 2. Protocol Summary, Page 10: DHCP clarifies the interpretation of the 'siaddr' field as the address of the server to use in the next step of the client's bootstrap process. A DHCP server may return its own address in the 'siaddr' field, if the server is prepared to supply the next bootstrap service (e.g., delivery of an operating system executable image). A DHCP server always returns its own address in the 'server identifier' option. Set the 'tftpserverip' env variable when the siaddr field contains an IP address that is different compared to the DHCP server IP address. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2026-02-04net: lwip: Use ipaddr helpersJonas Karlman
The ip_addr_t of lwIP has support for both IPv6 and IPv4 addresses. Some lwIP commans is directly accessing the internal addr field of the ip_addr_t instead of using ipaddr helper functions. Change to use ipaddr helper functions where appropriate to remove direct access of the internal addr field. Also change a few instances from ip4 to the version less ipaddr helpers. There is no intended functional change, besides the change from using ip4 addr helper to using version less ipaddr helper. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2026-02-04net: lwip: dns: Call env_set() from dns loop instead of found callbackJonas Karlman
The lwIP dns command handle env_set() calls from the found callback and printf() to console in the dns loop. Making it more complex than it needs to be. Simplify and ensure any environment variable that is being set is the same value that would have been printed on console. There should not be any intended change in behavior, besides the change from using ip4addr helper to using version less ipaddr helper. Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2026-02-04net: lwip: nfs: Print device name based on current udeviceJonas Karlman
Use udevice name, similar to other lwip commands, instead of using the legacy eth_get_name() when printing out the device being used. Fixes: 230cf3bc2776 ("net: lwip: nfs: Port the NFS code to work with lwIP") Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2026-02-04net: lwip: dns: Fix print of resolved IP addressJonas Karlman
The lwIP dns command only prints out cached resolved IP addresses. When a hostname is first resolved and ERR_INPROGRESS is returned the dns command prints out 0.0.0.0 instead of the resolved IP address. Fix this by printing out host_ipaddr instead of the temporary ipaddr that only is valid when ERR_OK is returned. Fixes: 1361d9f4f00a ("lwip: dns: do not print IP address when a variable is specified") Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2026-02-04net: lwip: add TFTPSERVERIP Kconfig optionJonas Karlman
With the legacy networking stack, it is possible to use USE_SERVERIP, SERVERIP and BOOTP_PREFER_SERVERIP Kconfg options to force use of a specific TFTP server ip. Using the lwIP networking stack use of the 'tftpserverip' environment variable provide the closest equivalent functionality. Add USE_TFTPSERVERIP and TFTPSERVERIP Kconfig options that can be used to add the 'tftpserverip' environment variable to force use of a specific TFTP server ip. Signed-off-by: Jonas Karlman <[email protected]> Acked-by: Jerome Forissier <[email protected]>
2026-02-04net: lwip: dhcp: Do not write past end of bufferAndrew Goodbody
sprintf will write a trailing \0 at the end of the string so when writing into a buffer, that buffer must be sized to allow for that trailing zero. In the DHCP code when the index is a number needing two digits to express the index would use up the two \0 bytes in the buffer and the trailing \0 from sprintf would be beyond the end of the allocation. Fix this by adding a third \0 in the buffer. This was found by code inspection when looking for an issue reported by Michal Simek, but I do not have the hardware to reproduce, so cannot confirm if this addresses that issue or not. Fixes: 98ad145db61a ("net: lwip: add DHCP support and dhcp commmand") Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2026-01-15net: tftpput: Rework to exclude code from xPL phasesTom Rini
Given how the support for CONFIG_CMD_TFTPPUT is woven through the support for the tftp protocol we currently end up including "put" support in xPL phases, if enabled. This in turn can lead to size overflow on those platforms as xPL tends to be constrained. To resolve this, use "CMD_TFTPPUT" in the code to check for both CONFIG_CMD_TFTPPUT being true and not being in an xPL build phase. Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2026-01-15net: lwip: nfs: Port the NFS code to work with lwIPAndrew Goodbody
After the preparatory patches moved most of the NFS code into common files we now add the code to enable NFS support with lwIP. Signed-off-by: Andrew Goodbody <[email protected]> Acked-by: Jerome Forissier <[email protected]>
2026-01-15net: nfs: Move most NFS code to common filesAndrew Goodbody
Move most of the NFS code into common files so that it can be used by an lwIP port of NFS. Acked-by: Jerome Forissier <[email protected]> Signed-off-by: Andrew Goodbody <[email protected]>
2026-01-15net: nfs: Add licence headerAndrew Goodbody
Add the same GPL2+ licence header to the NFS code as appears on other NFS related files. Acked-by: Jerome Forissier <[email protected]> Signed-off-by: Andrew Goodbody <[email protected]>
2026-01-15net: Move some variables to net-common filesAndrew Goodbody
Make some variables available to be used by either the legacy network code or lwIP by moving them into the net-common files. This also allowed removing a small number of duplicated variables from the lwIP code. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2026-01-15net: move net_state to net-commonAndrew Goodbody
Move the net_state variable into common code so that it can be used by either the legacy network code or lwIP. This is needed for porting across the NFS support code for use with lwIP. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2026-01-15net:lwip: Add debug line to net-lwipAndrew Goodbody
When debugging the LWIP NFS implementation this debug line helped to show the cause of an error. This could be useful to someone in the future. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2025-12-22Merge tag 'v2026.01-rc5' into nextTom Rini
Prepare v2026.01-rc5
2025-12-18net: lwip: tftp: Fix filename handlingAndrew Goodbody
The code to choose the filename to use does not cope with no name set at all. Firstly the test for a name in net_boot_file_name tests the pointer rather than the string it points to. Secondly the cleanup on exit in this case attempts to free a global variable. Fix both issues. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2025-12-05net: remove unreachable legacy LED codeQuentin Schulz
The code is guarded by a condition none of the defconfigs meet (that is CONFIG_SYS_FAULT_ECHO_LINK_DOWN and CONFIG_LED_STATUS_RED both enabled), so we can remove the unreachable code sections. When doing that, there's no caller for miiphy_link anymore, so it can be removed. This in turns makes CONFIG_SYS_FAULT_ECHO_LINK_DOWN and CONFIG_SYS_FAULT_MII_ADDR unused so they are removed as well. Signed-off-by: Quentin Schulz <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2025-12-01net: tftp: Remove tftp_init_load_addr error pathLeonard Anderweit
tftp_init_load_addr() always returns 0 since commit af45c84871e4 ("tftp: rework the logic to validate the load address"), so we don't need to check if it failed and can remove the error handling. Also change tftp_init_load_addr() to static void since the return value is now unused. Signed-off-by: Leonard Anderweit <[email protected]> Reviewed-by: Yannic Moog <[email protected]>
2025-10-24bootstd: make it possible to use tftp for netboot with standardbootBenjamin Hahn
Add the option to load the bootscript with the tftp command (static IP) instead of the dhcp command (dynamic IP). For this a new function tftpb_run similar to dhcp_run, is needed. The selection of which command to use can be done with the ip_dyn environment variable, which can be set to yes or no. The ip_dyn variable was chosen as it is already in use on the imx platforms. Also edit the bootstd doc. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Benjamin Hahn <[email protected]>
2025-10-22net: bootp: Prevent buffer overflow to avoid leaking the RAM contentPaul HENRYS
CVE-2024-42040 describes a possible buffer overflow when calling bootp_process_vendor() in bootp_handler() since the total length of the packet is passed to bootp_process_vendor() without being reduced to len-(offsetof(struct bootp_hdr,bp_vend)+4). The packet length is also checked against its minimum size to avoid reading data from struct bootp_hdr outside of the packet length. Signed-off-by: Paul HENRYS <[email protected]> Signed-off-by: Philippe Reynes <[email protected]>
2025-10-22net: make dhcp_run() common for NET and NET_LWIPJerome Forissier
There are currently two implementations of dhcp_run(): one in cmd/net.c for NET and one in net/lwip/dhcp.c for NET_LWIP. There is no justification for that. Therefore, move the NET version into net/net-common.c to be used by both stacks, and drop the NET_LWIP version which by the way does not look totally correct. Signed-off-by: Jerome Forissier <[email protected]> Suggested-by: Tom Rini <[email protected]> Acked-by: Benjamin Hahn <[email protected]>
2025-10-22net: Remove BOOTP_VENDOREX supportTom Rini
It has been over a decade since we had a platform that implemented the bootp vendor extension support hook. Remove this option due to lack of use. Signed-off-by: Tom Rini <[email protected]> Acked-by: Jerome Forissier <[email protected]>
2025-10-22net: Add SYS_FAULT_MII_ADDR to KconfigTom Rini
The support found under SYS_FAULT_ECHO_LINK_DOWN requires that the SYS_FAULT_MII_ADDR symbol also be set. This wasn't previously found in Kconfig, so add it now. Signed-off-by: Tom Rini <[email protected]> Acked-by: Jerome Forissier <[email protected]>
2025-10-22tftp: make TFTP ports unconditionally configurableAlvin Šipraga
A few lines of code being guarded by the CONFIG_TFTP_PORT option seems an unnecessary restriction on the TFTP support provided by a vanilla U-Boot image. In cases where the TFTP server cannot run as superuser - and hence cannot run on the well-known port 69 - this quirk incurs a full reconfiguration and rebuild of the bootloader only in order to select the appropriate destination port. Remove the CONFIG_TFTP_PORT option entirely and make the tftpdstp and tftpsrcp variables always have an effect. Their being unset will mean that U-Boot behaves the same as if CONFIG_TFTP_PORT was unset. Update the documentation accordingly. And fix up the single board which was originally enabling this option. Signed-off-by: Alvin Šipraga <[email protected]> Reviewed-by: Quentin Schulz <[email protected]>
2025-10-10net: mdio-uclass: introduce dm_eth_phy_connect_interface()Matthias Schiffer
dm_eth_phy_connect_interface() is a variant of dm_eth_phy_connect() that allows to set the used PHY mode, in case the MAC driver needs to fix it up. The previously static dm_eth_connect_phy_handle() is renamed and extended for this purpose. Signed-off-by: Matthias Schiffer <[email protected]>
2025-09-30net: lwip: ensure alignment of packet buffersTim Harvey
Network packet buffers should be aligned to PKTALIGN. Add a compiler attribute to ensure this. Signed-off-by: Tim Harvey <[email protected]> [jf: use __aligned(x) from <linux/compiler_attributes.h>] Signed-off-by: Jerome Forissier <[email protected]>
2025-09-30net: lwip: dhcp: set ntpserverip environment variableJerome Forissier
Once the DHCP exchange is complete, if we have an IP address for an NTP server, set the ntpserverip environment variable accordingly. Although not necessary to make the sntp command use that server (since it is known internally to the lwIP stack), this makes the behavior in line with the legacy NET stack. This is also consistent with exporting the DNS servers etc. Signed-off-by: Jerome Forissier <[email protected]> Suggested-by: Michal Simek <[email protected]>
2025-09-30net: lwip: dhcp: make NTP servers usable by the sntp commandJerome Forissier
When both CMD_DHCP and CMD_SNTP are enabled, one would expect the NTP servers received by DHCP to be used by the sntp command by default. Fix dhcp_loop() so that it is indeed the case. Signed-off-by: Jerome Forissier <[email protected]> Reported-by: Michal Simek <[email protected]>
2025-08-18net: lwip: ping: set net_try_count to 1Jerome Forissier
The legacy network stack sets net_try_count to 1 at the beginning of the net_loop() function. This is required for net_start_again() to work properly. Therefore, set the variable accordingly in the do_ping() function when NET_LWIP=y. This fixes an issue where a ping to an unreachable destination would run twice on the same network device. For example with qemu_arm64_lwip_defconfig: => dhcp DHCP client bound to address 10.0.2.15 (3 ms) => ping 10.0.0.1 Using virtio-net#32 device ping failed; host 10.0.0.1 is not alive Using virtio-net#32 device ping failed; host 10.0.0.1 is not alive => QEMU: Terminated Signed-off-by: Jerome Forissier <[email protected]>
2025-08-18net: introduce CONFIG_DNSJerome Forissier
Introduce the DNS Kconfig symbol so that various network commands may use host names without the dns command (CMD_DNS) being selected. Signed-off-by: Jerome Forissier <[email protected]> CC: E Shattow <[email protected]>
2025-08-18net: add missing SPDX-License-Identifier for files originating from LiMonMax Merchel
The header of LiMon imported files reference a License file which does not exist in U-Boot. Some files were forgotten when adding the SPDX-License-Identifier. The LiMon files were originally licensed under GPLv2 as can be seen in commit [2ea91039]. Based on this commit, add the correct SPDX license identifier. While at it drop the reference to the non-existing License file from all LiMon files and update the SPDX-License-Identifier to SPDX version 3. Signed-off-by: Max Merchel <[email protected]>
2025-08-18net: lwip: add Kconfig option to show ICMP unreachable errorsJerome Forissier
Add Kconfig symbol LWIP_ICMP_SHOW_UNREACH which, when enabled, prints a message to the console upon reception of ICMP unreachable messages. For example: $ make qemu_arm64_lwip_defconfig $ qemu-system-aarch64 -M virt -cpu max -nographic -bios u-boot.bin [...] => dhcp DHCP client bound to address 10.0.2.15 (0 ms) => tftp 192.168.0.100:69:Image Using virtio-net#32 device TFTP from server 192.168.0.100; our IP address is 10.0.2.15 Filename 'Image'. Load address: 0x40200000 Loading: ICMP destination unreachable (host unreachable) from 192.168.0.16 Timeout! => tftp 192.168.0.16:69:Image Using virtio-net#32 device TFTP from server 192.168.0.16; our IP address is 10.0.2.15 Filename 'Image'. Load address: 0x40200000 Loading: ICMP destination unreachable (port unreachable) from 192.168.0.16 Timeout! => Submitted upstream as https://github.com/lwip-tcpip/lwip/pull/73. Signed-off-by: Jerome Forissier <[email protected]>
2025-08-01net: lwip: remove eth_init from net_init as it is called laterTim Harvey
The call to eth_init within net_init causes the network interface to start, stop, start again which can cause issues with certain network device drivers. Remove it to make it behave like the legacy network path. Fixes: 5666865decb8 ("net: lwip: fix initialization sequence before a command") Signed-off-by: Tim Harvey <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2025-08-01net: lwip: simplify net_lwip_eth_startTim Harvey
For NET_LWIP eth_is_on_demand_init() is always 1 so remove the check and simplify the code. Suggested-by: Jerome Forissier <[email protected]> Signed-off-by: Tim Harvey <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2025-08-01net: wget: Fix comparison of unsigned variableAndrew Goodbody
content_length is an unsigned long and so testing that it is >= 0 will always be true. Instead test that it is != -1 as that is the condition set on error. This issue found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2025-08-01net: Incorrect NOP macro used for testAndrew Goodbody
In tcp_parse_options the uchar p[0] is attempted to test for a match with the 32bit macro TCP_0_NOP which can never be true. Instead test against the 8bit macro TCP_1_NOP. This issue found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2025-07-08net: extract function net_sntp_set_rtc() from sntp_handler()Jerome Forissier
Extract the code that sets the RTC clock from sntp_handler() in net/sntp.c and make it a new function net_sntp_set_rtc() in net/net-common.c. This will allow re-use with NET_LWIP. According to [1] it is safe to assume that all devices have been converted to DM_RTC so drop the useless code. [1] https://lists.denx.de/pipermail/u-boot/2025-June/591376.html Signed-off-by: Jerome Forissier <[email protected]>
2025-07-08lwip: add net_lwip_dns_resolve()Jerome Forissier
Add a helper fonction to convert an IP address (supplied as a text string) or a host name to an ip_addr_t. Signed-off-by: Jerome Forissier <[email protected]>