From 6819689d31f28513020ca90ffa553dee408cade7 Mon Sep 17 00:00:00 2001 From: hankangkang Date: Sat, 30 Nov 2024 19:04:25 +0800 Subject: [PATCH] bug: free sock when exit (cherry picked from commit 32b9ab7f27450cda7940fcdd20ca99a1f1292528) --- 0001-bug-free-sock-when-func-goto-out.patch | 37 +++++++++++++++++++++ lwip.spec | 6 +++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 0001-bug-free-sock-when-func-goto-out.patch diff --git a/0001-bug-free-sock-when-func-goto-out.patch b/0001-bug-free-sock-when-func-goto-out.patch new file mode 100644 index 0000000..d362487 --- /dev/null +++ b/0001-bug-free-sock-when-func-goto-out.patch @@ -0,0 +1,37 @@ +From f63f1404ab96bfaa357a89c8e91cb65a357eb761 Mon Sep 17 00:00:00 2001 +From: hankangkang +Date: Mon, 2 Dec 2024 16:31:57 +0800 +Subject: [PATCH] bug: free sock when func goto out + +--- + src/api/lwipgz_sock.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/api/lwipgz_sock.c b/src/api/lwipgz_sock.c +index 5419057..401c523 100644 +--- a/src/api/lwipgz_sock.c ++++ b/src/api/lwipgz_sock.c +@@ -119,15 +119,17 @@ int gazelle_alloc_socket(struct netconn *newconn, int accepted, int flags) + return fd; + + out: +- if (sock != NULL) +- sock->conn = NULL; +- posix_api->close_fn(fd); ++ gazelle_free_socket(sock, fd); + return -1; + } + + /* reference tag: free_socket() */ + void gazelle_free_socket(struct lwip_sock *sock, int fd) + { ++ if (sock != NULL) { ++ sock->conn = NULL; ++ } ++ + do_lwip_clean_sock(fd); + posix_api->close_fn(fd); + } +-- +2.33.0 + diff --git a/lwip.spec b/lwip.spec index 7ac3755..2fd341f 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.2.0 -Release: 64 +Release: 65 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip @@ -189,6 +189,7 @@ Patch9173: 0174-bugfix-Codedump-occurs-when-the-GAZELLE_TCP_REUSE_IP.patch Patch9174: 0175-fix-IFNAMSIZ-definition-conflict-between-lwip-and-ke.patch Patch9175: 0176-fix-no-ack-response-when-lcoal-only-receive-but-not-.patch +Patch9176: 0001-bug-free-sock-when-func-goto-out.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -218,6 +219,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Thu Nov 28 2024 hankangkang - 2.2.0-65 +- bug: free sock when exit + * Fri Nov 15 2024 jiangheng - 2.2.0-64 - fix no ack response when lcoal only receive but not send data -- Gitee