From 6ae963a4089b4c937d72c29c89919a43fe5e09a9 Mon Sep 17 00:00:00 2001 From: yangchen Date: Fri, 26 Jan 2024 18:16:18 +0800 Subject: [PATCH] support udp recv zero packets (cherry picked from commit f429ab929f17a65b8da97f14bc269a3face814e6) --- 0109-support-udp-recv-zero-packets.patch | 25 ++++++++++++++++++++++++ lwip.spec | 6 +++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 0109-support-udp-recv-zero-packets.patch diff --git a/0109-support-udp-recv-zero-packets.patch b/0109-support-udp-recv-zero-packets.patch new file mode 100644 index 0000000..4b37939 --- /dev/null +++ b/0109-support-udp-recv-zero-packets.patch @@ -0,0 +1,25 @@ +From cbde011450b38359d494bcc18ae91c690e5c5d43 Mon Sep 17 00:00:00 2001 +From: yangchen +Date: Fri, 26 Jan 2024 17:28:29 +0800 +Subject: [PATCH] support udp recv zero packets + +--- + src/api/sockets.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/api/sockets.c b/src/api/sockets.c +index d8b41e4..c133fc2 100644 +--- a/src/api/sockets.c ++++ b/src/api/sockets.c +@@ -1385,7 +1385,7 @@ lwip_recvfrom_udp_raw(struct lwip_sock *sock, int flags, struct msghdr *msg, u16 + LWIP_UNUSED_ARG(copied); + LWIP_UNUSED_ARG(i); + buflen = do_lwip_read_from_lwip(sock, flags, apiflags); +- if (buflen <= 0) { ++ if (buflen < 0) { + return ERR_BUF; + } + +-- +2.33.0 + diff --git a/lwip.spec b/lwip.spec index 2e0df55..52af401 100644 --- a/lwip.spec +++ b/lwip.spec @@ -4,7 +4,7 @@ Summary: lwip is a small independent implementation of the TCP/IP protocol suite Name: lwip Version: 2.1.3 -Release: 114 +Release: 115 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip @@ -125,6 +125,7 @@ Patch9104: 0105-delete-redundant-logs-in-lwip.patch Patch9105: 0106-remove-unnecessary-variables-in-struct-pbuf.patch Patch9106: 0107-fix-move-lpcb-to-the-front-of-list-error.patch Patch9107: 0108-fix-receive-fin-packet-process-error.patch +Patch9108: 0109-support-udp-recv-zero-packets.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -154,6 +155,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Thu Feb 01 2024 yangchen - 2.1.3-115 +- support udp recv zero packets + * Tue Jan 30 2024 jiangheng - 2.1.3-114 - fix receive fin packet process error