From 43776f073baf558bb90c53df2a00348656fa0e2e Mon Sep 17 00:00:00 2001 From: wuchangye Date: Fri, 8 Dec 2023 14:51:32 +0800 Subject: [PATCH] fix the coredump issue when UDP traffic is sent (cherry picked from commit dda6aea7d5407032405248533f7f53f9c7ad370b) --- ...edump-issue-when-UDP-traffic-is-sent.patch | 30 +++++++++++++++++++ lwip.spec | 6 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0092-fix-the-coredump-issue-when-UDP-traffic-is-sent.patch diff --git a/0092-fix-the-coredump-issue-when-UDP-traffic-is-sent.patch b/0092-fix-the-coredump-issue-when-UDP-traffic-is-sent.patch new file mode 100644 index 0000000..5da5819 --- /dev/null +++ b/0092-fix-the-coredump-issue-when-UDP-traffic-is-sent.patch @@ -0,0 +1,30 @@ +From defef8f57ee35b510c4a542e54237f664ac31d5d Mon Sep 17 00:00:00 2001 +From: root +Date: Sat, 9 Dec 2023 16:54:47 +0800 +Subject: [PATCH] fix the coredump issue when UDP traffic is sent + +--- + src/api/sockets.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/api/sockets.c b/src/api/sockets.c +index d488b5b..a9d39ae 100644 +--- a/src/api/sockets.c ++++ b/src/api/sockets.c +@@ -1865,7 +1865,13 @@ lwip_sendto(int s, const void *data, size_t size, int flags, + } else + #endif /* LWIP_CHECKSUM_ON_COPY */ + { ++#if GAZELLE_ENABLE ++ /* In the gazelle scenario, the payload is stored in send_ring, ++ and the payload stores the sock pointer information. */ ++ buf.p->payload = (void *)sock; ++#else + MEMCPY(buf.p->payload, data, short_size); ++#endif + } + err = ERR_OK; + } +-- +2.30.0 + diff --git a/lwip.spec b/lwip.spec index cbf0e3d..0a4c0d5 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: 94 +Release: 95 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip @@ -105,6 +105,7 @@ Patch9087: 0088-modify-log-info-err.patch Patch9088: 0089-add-struct-gz-addr.patch Patch9089: 0090-frag-fix-coredump-when-get-netif.patch Patch9090: 0091-add-fd-log-info-and-fix-wrong-port-log-info.patch +Patch9091: 0092-fix-the-coredump-issue-when-UDP-traffic-is-sent.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -135,6 +136,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Sat Dec 9 2023 wuchangye - 2.1.3-95 +- fix the coredump issue when UDP traffic is sent + * Fri Dec 8 2023 yangchen - 2.1.3-94 - add fd log info and fix wrong port log info