diff --git a/0017-support-REUSEPOR-option.patch b/0017-support-REUSEPOR-option.patch new file mode 100644 index 0000000000000000000000000000000000000000..c6c8b0f2acc621ad48cff5334f67423d4bd6f01f --- /dev/null +++ b/0017-support-REUSEPOR-option.patch @@ -0,0 +1,58 @@ +From 670f888704c7bbb1121e63bc380ca34b83c43464 Mon Sep 17 00:00:00 2001 +From: jiangheng +Date: Thu, 3 Mar 2022 17:06:03 +0800 +Subject: [PATCH] support REUSEPOR option fix rpc msg too much + fix recurring events + +--- + src/api/sockets.c | 4 ++++ + src/include/lwipsock.h | 10 ++++++++-- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/src/api/sockets.c b/src/api/sockets.c +index b032ce9..4b682f3 100644 +--- a/src/api/sockets.c ++++ b/src/api/sockets.c +@@ -3029,6 +3029,10 @@ lwip_sockopt_to_ipopt(int optname) + return SOF_KEEPALIVE; + case SO_REUSEADDR: + return SOF_REUSEADDR; ++#if USE_LIBOS ++ case SO_REUSEPORT: ++ return SO_REUSEPORT; ++#endif + default: + LWIP_ASSERT("Unknown socket option", 0); + return 0; +diff --git a/src/include/lwipsock.h b/src/include/lwipsock.h +index 069cdcb..e2519ff 100644 +--- a/src/include/lwipsock.h ++++ b/src/include/lwipsock.h +@@ -94,7 +94,8 @@ struct lwip_sock { + #if USE_LIBOS + uint32_t epoll_events; /* registered events */ + uint32_t events; /* available events */ +- int32_t in_event; /* avoid recurring events */ ++ volatile bool have_event; /* avoid recurring events */ ++ volatile bool have_rpc_send; /* avoid recurring rpc_send */ + epoll_data_t ep_data; + struct weakup_poll *weakup; + struct protocol_stack *stack; +@@ -103,8 +104,13 @@ struct lwip_sock { + struct pbuf *send_lastdata; /* unread data in one pbuf */ + void *send_ring; + int32_t recv_flags; +- int32_t nextfd; /* listenfd list */ ++ bool wait_close; ++ int32_t attach_fd; ++ struct lwip_sock *shadowed_sock; ++ struct list_node attach_list; ++ struct list_node listen_list; + struct list_node recv_list; ++ int32_t nextfd; /* listenfd list */ + #endif + }; + +-- +1.8.3.1 + diff --git a/lwip.spec b/lwip.spec index a9b702789489ff3a5ab3172c375c2226d257c368..16722837cc6ae14c9ba2053a4ec5f54d4fa538b2 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: 3 +Release: 4 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.tar.gz @@ -25,6 +25,7 @@ Patch9012: 0013-remove-gazelle-syscall-thread.patch Patch9013: 0014-fix-some-compile-errors.patch Patch9014: 0015-fix-tcp-port-alloc-issue.patch Patch9015: 0016-lstack-support-mysql-mode.patch +Patch9016: 0017-support-REUSEPOR-option.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -55,6 +56,7 @@ find %{_builddir}/%{name}-%{version} -type f -exec dos2unix -q {} \; %patch9013 -p1 %patch9014 -p1 %patch9015 -p1 +%patch9016 -p1 %build cd %{_builddir}/%{name}-%{version}/src @@ -70,6 +72,11 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Thu Mar 03 2022 jiangheng - 2.1.3-4 +- support REUSEPOR option +- fix rpc msg too much +- fix recrruing events + * Thu Feb 24 2022 jiangheng - 2.1.3-3 - remove kernel socket interface - support the mode that listen and accept thread be separaten