diff --git a/0022-notify-app-that-sock-state-changes-to-CLOSE_WAIT.patch b/0022-notify-app-that-sock-state-changes-to-CLOSE_WAIT.patch new file mode 100644 index 0000000000000000000000000000000000000000..be4b0e78ce9ce06a77c2cc6eef7e9b9266e533b9 --- /dev/null +++ b/0022-notify-app-that-sock-state-changes-to-CLOSE_WAIT.patch @@ -0,0 +1,56 @@ +From 05159c41efdc2f07ddbe3520330faf2675baa3d6 Mon Sep 17 00:00:00 2001 +From: jiangheng +Date: Tue, 15 Mar 2022 20:10:07 +0800 +Subject: [PATCH] notify app that sock changes to CLOSE_WAAIT + +--- + src/core/tcp_in.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c +index 1652b86..0d3a2f1 100644 +--- a/src/core/tcp_in.c ++++ b/src/core/tcp_in.c +@@ -58,6 +58,9 @@ + #if LWIP_ND6_TCP_REACHABILITY_HINTS + #include "lwip/nd6.h" + #endif /* LWIP_ND6_TCP_REACHABILITY_HINTS */ ++#if USE_LIBOS ++#include "lwip/api.h" ++#endif + + #include + +@@ -1032,6 +1035,9 @@ tcp_process(struct tcp_pcb *pcb) + if (recv_flags & TF_GOT_FIN) { + tcp_ack_now(pcb); + pcb->state = CLOSE_WAIT; ++#if USE_LIBOS ++ API_EVENT(((struct netconn *)pcb->callback_arg), NETCONN_EVT_ERROR, 0); ++#endif + } + } else { + /* incorrect ACK number, send RST */ +@@ -1050,6 +1056,9 @@ tcp_process(struct tcp_pcb *pcb) + if (recv_flags & TF_GOT_FIN) { /* passive close */ + tcp_ack_now(pcb); + pcb->state = CLOSE_WAIT; ++#if USE_LIBOS ++ API_EVENT(((struct netconn *)pcb->callback_arg), NETCONN_EVT_ERROR, 0); ++#endif + } + break; + case FIN_WAIT_1: +@@ -1676,6 +1685,9 @@ tcp_receive(struct tcp_pcb *pcb) + recv_flags |= TF_GOT_FIN; + if (pcb->state == ESTABLISHED) { /* force passive close or we can move to active close */ + pcb->state = CLOSE_WAIT; ++#if USE_LIBOS ++ API_EVENT(((struct netconn *)pcb->callback_arg), NETCONN_EVT_ERROR, 0); ++#endif + } + } + +-- +1.8.3.1 + diff --git a/lwip.spec b/lwip.spec index 352e0b4843c8ce8cec9ab90a0d7714e391133f85..938d538a1382bf7ee8cdf4b9aaf379d86921f9dc 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: 8 +Release: 9 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.tar.gz @@ -30,6 +30,7 @@ Patch9017: 0018-exec-gazelle_init_sock-before-read-event.patch Patch9018: 0019-gazelle-reduce-copy-in-send.patch Patch9019: 0020-remove-chose_dlsym_handle-function-set-handle-to-RTL.patch Patch9020: 0021-refactor-event-if-ring-is-full-the-node-is-added-to-.patch +Patch9021: 0022-notify-app-that-sock-state-changes-to-CLOSE_WAIT.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -58,6 +59,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Tue Mar 15 2022 jiangheng - 2.1.3-9 +- notify app that sock state changes to CLOSE_WAIT + * Tue Mar 15 2022 jiangheng - 2.1.3-8 - refactor event,if ring is full, node is added to list