diff --git a/0170-IPV6-Enable-IPV6_FRAG_COPYHEADER-macro-to-adapt-64bi.patch b/0170-IPV6-Enable-IPV6_FRAG_COPYHEADER-macro-to-adapt-64bi.patch new file mode 100644 index 0000000000000000000000000000000000000000..d777216f69f3a50342c7dd0ba0cbf36e8f2df42a --- /dev/null +++ b/0170-IPV6-Enable-IPV6_FRAG_COPYHEADER-macro-to-adapt-64bi.patch @@ -0,0 +1,25 @@ +From d451214b0761977f016ef0d7b248847d5cc643f5 Mon Sep 17 00:00:00 2001 +From: yinbin +Date: Sat, 12 Oct 2024 17:36:27 +0800 +Subject: [PATCH 1/3] IPV6: Enable IPV6_FRAG_COPYHEADER macro to adapt 64bit + env + +--- + src/include/lwipopts.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/include/lwipopts.h b/src/include/lwipopts.h +index c3ecb21..c46dce9 100644 +--- a/src/include/lwipopts.h ++++ b/src/include/lwipopts.h +@@ -187,6 +187,7 @@ + #define LWIP_IPV6 1 + #define IP6_HLEN 40 + #define LWIP_IPV6_SCOPES 1 ++#define IPV6_FRAG_COPYHEADER 1 + + /* + --------------------------------- +-- +2.34.1 + diff --git a/0171-IPV6-fix-array-out-of-bounds-in-function-ip6_ntoa_r.patch b/0171-IPV6-fix-array-out-of-bounds-in-function-ip6_ntoa_r.patch new file mode 100644 index 0000000000000000000000000000000000000000..dc87a87180bf423ec171789018679cc34f1b2f0e --- /dev/null +++ b/0171-IPV6-fix-array-out-of-bounds-in-function-ip6_ntoa_r.patch @@ -0,0 +1,25 @@ +From 99400e4659fbd84adecdf621f213e0f7f329556c Mon Sep 17 00:00:00 2001 +From: yinbin +Date: Mon, 14 Oct 2024 09:19:26 +0800 +Subject: [PATCH 2/3] IPV6: fix array out of bounds in function ip6_ntoa_r + +--- + src/core/ipv6/ip6_addr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/core/ipv6/ip6_addr.c b/src/core/ipv6/ip6_addr.c +index 6e0ac86..dfcc5b1 100644 +--- a/src/core/ipv6/ip6_addr.c ++++ b/src/core/ipv6/ip6_addr.c +@@ -278,7 +278,7 @@ ip6addr_ntoa_r(const ip6_addr_t *addr, char *buf, int buflen) + } + break; + } +- if (empty_block_flag == 0) { ++ if (empty_block_flag == 0 && current_block_value < 7) { + /* generate empty block "::", but only if more than one contiguous zero block, + * according to current formatting suggestions RFC 5952. */ + next_block_value = lwip_htonl(addr->addr[(current_block_index + 1) >> 1]); +-- +2.34.1 + diff --git a/0172-IPV6-add-group-check-while-mld6-schedule-a-report.patch b/0172-IPV6-add-group-check-while-mld6-schedule-a-report.patch new file mode 100644 index 0000000000000000000000000000000000000000..d4ce1ef3f942178c3f61b9c19736178a2a4f4010 --- /dev/null +++ b/0172-IPV6-add-group-check-while-mld6-schedule-a-report.patch @@ -0,0 +1,43 @@ +From c73d8f324d14c2433d2a59724c2ea4ff7a9ea979 Mon Sep 17 00:00:00 2001 +From: yinbin +Date: Mon, 14 Oct 2024 15:45:07 +0800 +Subject: [PATCH] IPV6: add group check while mld6 schedule a report + +--- + src/core/ipv6/mld6.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/src/core/ipv6/mld6.c b/src/core/ipv6/mld6.c +index 3aecb35..ffa2faf 100644 +--- a/src/core/ipv6/mld6.c ++++ b/src/core/ipv6/mld6.c +@@ -292,11 +292,14 @@ mld6_input(struct pbuf *p, struct netif *inp) + ip6_addr_copy(group_addr, mld_v2_hdr->multicast_address); + group = mld6_lookfor_group(inp, &group_addr); + ++ if (group == NULL) { ++ MLD6_STATS_INC(mld6.drop); ++ break; ++ } ++ + if (0 == src_num) { +- if (group != NULL) { +- /* Schedule a report. */ +- mld6_v2_delayed_report(group, lwip_ntohs(mld_v2_hdr->max_resp_delay)); +- } ++ /* Schedule a report. */ ++ mld6_v2_delayed_report(group, lwip_ntohs(mld_v2_hdr->max_resp_delay)); + } else { + src_buf = (ip6_addr_p_t *)mem_malloc(src_buf_size); + if (src_buf == NULL) { +@@ -310,6 +313,7 @@ mld6_input(struct pbuf *p, struct netif *inp) + /* We interest! */ + mld6_v2_delayed_report(group, lwip_ntohs(mld_v2_hdr->max_resp_delay)); + } ++ mem_free(src_buf); + } + } + } +-- +2.34.1 + diff --git a/lwip.spec b/lwip.spec index 764b17c84d5d7dbf4e4967309ee1be07b370b2a5..73065e6b31d8d1581513aa9f542b4726b85a821c 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: 59 +Release: 60 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip @@ -181,6 +181,9 @@ Patch9165: 0166-cleancode-rename-log-level.patch Patch9166: 0167-lwip-add-pingpong-mode-support.patch Patch9167: 0168-lwip-adapt-interrupt-mode.patch Patch9168: 0169-pingpong-fix-send-dup-ack.patch +Patch9169: 0170-IPV6-Enable-IPV6_FRAG_COPYHEADER-macro-to-adapt-64bi.patch +Patch9170: 0171-IPV6-fix-array-out-of-bounds-in-function-ip6_ntoa_r.patch +Patch9171: 0172-IPV6-add-group-check-while-mld6-schedule-a-report.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -210,6 +213,11 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Mon Oct 14 2024 yinbin - 2.2.0-60 +- IPV6: Enable IPV6_FRAG_COPYHEADER macro to adapt 64bit +- IPV6: fix array out of bounds in function ip6_ntoa_r +- IPV6: add group check while mld6 schedule a report + * Mon Sep 30 2024 jiangheng - 2.2.0-59 - pingpong: fix send dup ack in fast timer