From 1e6cf2e345cc240bb7df9181d6fa91331d04e71f Mon Sep 17 00:00:00 2001 From: yinbin Date: Tue, 20 Aug 2024 19:38:32 +0800 Subject: [PATCH] check if mem_init returns errno (cherry picked from commit a12012bcef9c04aba33bd065bcad7cbd8a1387c8) --- 0162-check-if-mem_init-returns-errno.patch | 32 ++++++++++++++++++++++ lwip.spec | 6 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 0162-check-if-mem_init-returns-errno.patch diff --git a/0162-check-if-mem_init-returns-errno.patch b/0162-check-if-mem_init-returns-errno.patch new file mode 100644 index 0000000..5c1111f --- /dev/null +++ b/0162-check-if-mem_init-returns-errno.patch @@ -0,0 +1,32 @@ +From d62c3da349d4e255d1f81b2f28db938027a1b73a Mon Sep 17 00:00:00 2001 +From: yinbin +Date: Tue, 20 Aug 2024 19:05:43 +0800 +Subject: [PATCH] check if mem_init returns errno + +--- + src/core/init.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/core/init.c b/src/core/init.c +index dbe89d7..e6cd9b6 100644 +--- a/src/core/init.c ++++ b/src/core/init.c +@@ -357,9 +357,14 @@ lwip_init(void) + sys_init(); + #endif /* !NO_SYS */ + mem_init(); ++#if GAZELLE_ENABLE ++ /* mem_init() will set failed errno. */ ++ if (errno != 0) ++ return; ++#endif /* GAZELLE_ENABLE */ + memp_init(); + #if GAZELLE_ENABLE +- /* mem_init() and memp_init() will set failed errno. */ ++ /* memp_init() will set failed errno. */ + if (errno != 0) + return; + #endif /* GAZELLE_ENABLE */ +-- +2.34.1 + diff --git a/lwip.spec b/lwip.spec index f5c5a53..7321c47 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: 52 +Release: 53 License: BSD URL: http://savannah.nongnu.org/projects/lwip/ Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip @@ -173,6 +173,7 @@ Patch9157: 0158-enable-sys_arch-failed-log.patch Patch9158: 0159-LOOPBACK-fix-loop-coredump.patch Patch9159: 0160-INIT-fix-lwip_init-failed-because-of-dpdk-set-errno.patch Patch9160: 0161-fix-the-definition-of-IPV6_V6ONLY.patch +Patch9161: 0162-check-if-mem_init-returns-errno.patch BuildRequires: gcc-c++ dos2unix dpdk-devel @@ -202,6 +203,9 @@ cd %{_builddir}/%{name}-%{version}/src %{_libdir}/liblwip.a %changelog +* Tue Aug 20 2024 yinbin - 2.2.0-53 +- check if mem_init returns errno + * Tue Aug 13 2024 yangchen - 2.2.0-52 - fix the definition of IPV6_V6ONLY