bug: free sock when exit

(cherry picked from commit 32b9ab7f27450cda7940fcdd20ca99a1f1292528)
This commit is contained in:
hankangkang 2024-11-30 19:04:25 +08:00 committed by openeuler-sync-bot
parent c2d4e4762f
commit 73e6d3e7f4
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,37 @@
From f63f1404ab96bfaa357a89c8e91cb65a357eb761 Mon Sep 17 00:00:00 2001
From: hankangkang <hankangkang5@huawei.com>
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

View File

@ -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 <hankangkang5@huawei.com> - 2.2.0-65
- bug: free sock when exit
* Fri Nov 15 2024 jiangheng <jiangheng14@huawei.com> - 2.2.0-64
- fix no ack response when lcoal only receive but not send data