net/udp: Support zero-length UDP datagrams

According to RFC768 page2 and referring to the Linux implementation, the message with udp length of 0 is supported.

Signed-off-by: gaohedong <gaohedong@xiaomi.com>
This commit is contained in:
gaohedong
2025-09-05 16:31:40 +08:00
committed by Xiang Xiao
parent c72ae882da
commit 4d525505e4
5 changed files with 153 additions and 138 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ void udp_poll(FAR struct net_driver_s *dev, FAR struct udp_conn_s *conn)
/* If the application has data to send, setup the UDP/IP header */
if (dev->d_sndlen > 0)
if (dev->d_len > 0)
{
udp_send(dev, conn);
return;