From 6743f50df288327389387e6d7c80398ac022a8cf Mon Sep 17 00:00:00 2001 From: jiangheng Date: Fri, 8 Dec 2023 11:17:07 +0800 Subject: [PATCH] ip4 frag: fix coredump when get netif --- 0090-frag-fix-coredump-when-get-netif.patch | 28 +++++++++++++++++++++ lwip.spec | 6 ++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 0090-frag-fix-coredump-when-get-netif.patch diff --git a/0090-frag-fix-coredump-when-get-netif.patch b/0090-frag-fix-coredump-when-get-netif.patch new file mode 100644 index 0000000..2e6bed2 --- /dev/null +++ b/0090-frag-fix-coredump-when-get-netif.patch @@ -0,0 +1,28 @@ +From 5e5195ad88819a77d59038ec49004d1e11801d08 Mon Sep 17 00:00:00 2001 +From: jiangheng +Date: Fri, 8 Dec 2023 11:14:15 +0800 +Subject: [PATCH] frag: fix coredump when get netif + +--- + src/core/ipv4/ip4_frag.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/core/ipv4/ip4_frag.c b/src/core/ipv4/ip4_frag.c +index f63a99e..b4a183a 100644 +--- a/src/core/ipv4/ip4_frag.c ++++ b/src/core/ipv4/ip4_frag.c +@@ -640,9 +640,9 @@ ip4_reass(struct pbuf *p) + IPH_CHKSUM_SET(fraghdr, 0); + /* @todo: do we need to set/calculate the correct checksum? */ + #if CHECKSUM_GEN_IP +- IF__NETIF_CHECKSUM_ENABLED(ip_current_input_netif(), NETIF_CHECKSUM_GEN_IP) { ++ IF__NETIF_CHECKSUM_ENABLED(default_netif, NETIF_CHECKSUM_GEN_IP) { + #if CHECKSUM_GEN_IP_HW +- if (netif_get_txol_flags(ip_current_input_netif()) & DEV_TX_OFFLOAD_IPV4_CKSUM) { ++ if (netif_get_txol_flags(default_netif) & DEV_TX_OFFLOAD_IPV4_CKSUM) { + iph_cksum_set(p, IP_HLEN, 1); + } else { + iph_cksum_set(p, IP_HLEN, 0); +-- +2.27.0 + diff --git a/lwip.spec b/lwip.spec index abd39e6..2f1530d 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: 92 +Release: 93 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip @@ -103,6 +103,7 @@ Patch9085: 0086-log-add-errevent-log-and-tcp-exception-statistics.patch Patch9086: 0087-support-vlan-offload.patch Patch9087: 0088-modify-log-info-err.patch Patch9088: 0089-add-struct-gz-addr.patch +Patch9089: 0090-frag-fix-coredump-when-get-netif.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -133,6 +134,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Fri Dec 8 2023 jiangheng - 2.1.3-93 +- ip4 frag: fix coredump when get netif + * Wed Dec 6 2023 zhengjiebing - 2.1.3-92 - add struct gz_addr_t