This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 3d000232d5be7fa27fa547f30ff3ab9bd3aeb7d9 Author: zhangshuai39 <[email protected]> AuthorDate: Thu Dec 18 11:24:29 2025 +0800 net/udp: Add Ethernet header to loopback message IPv4_in/IPv6_in subtracts the link layer header length, but loopback packets leaving the Ethernet card lack a link layer header, causing the packets to be dropped due to the length mismatch. Signed-off-by: zhangshuai39 <[email protected]> --- net/udp/udp_send.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/udp/udp_send.c b/net/udp/udp_send.c index 93c6b730d93..4eb2575ec80 100644 --- a/net/udp/udp_send.c +++ b/net/udp/udp_send.c @@ -87,12 +87,15 @@ static void udp_send_loopback(FAR struct net_driver_s *dev) { FAR struct iob_s *iob = netdev_iob_clone(dev, true); + if (iob == NULL) { nerr("ERROR: IOB clone failed when looping UDP.\n"); return; } + devif_out(dev); + #ifdef CONFIG_NET_IPv4 #ifdef CONFIG_NET_IPv6 if (IFF_IS_IPv4(dev->d_flags))
