summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-03-24 22:04:03 -0700
committerKhem Raj <raj.khem@gmail.com>2024-03-24 22:52:26 -0700
commitccff89588a5f4fa58a47f6970c6a2b1f20f06a8a (patch)
treeb658ee0013a9d73681eed5190be54af5e25c62e2
parent742c3da8747b291e9624fc83948d5dc3ba04a33e (diff)
downloadmeta-openembedded-ccff89588a5f4fa58a47f6970c6a2b1f20f06a8a.tar.gz
ipset: Update to 7.21
Fix build with latest musl while here Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-networking/recipes-filter/ipset/ipset/0001-ipset-Define-portable-basename-function.patch50
-rw-r--r--meta-networking/recipes-filter/ipset/ipset_7.21.bb (renamed from meta-networking/recipes-filter/ipset/ipset_7.19.bb)5
2 files changed, 53 insertions, 2 deletions
diff --git a/meta-networking/recipes-filter/ipset/ipset/0001-ipset-Define-portable-basename-function.patch b/meta-networking/recipes-filter/ipset/ipset/0001-ipset-Define-portable-basename-function.patch
new file mode 100644
index 000000000..a06bcac36
--- /dev/null
+++ b/meta-networking/recipes-filter/ipset/ipset/0001-ipset-Define-portable-basename-function.patch
@@ -0,0 +1,50 @@
1From 8c5c0a7a48af7652c50bc27a4efdd9cb4f7d95bd Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 24 Mar 2024 21:58:50 -0700
4Subject: [PATCH] ipset: Define portable basename function
5
6Newer version of musl have removed prototype for basename in string.h [1]
7which now makes it fail to compile with newer clang 18+ compiler therefore
8define own basename utility function and not depend on platform for it.
9
10[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
11
12Upstream-Status: Pending
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 src/ipset.c | 12 +++++++++++-
16 1 file changed, 11 insertions(+), 1 deletion(-)
17
18diff --git a/src/ipset.c b/src/ipset.c
19index 162f477..7b5d580 100644
20--- a/src/ipset.c
21+++ b/src/ipset.c
22@@ -16,6 +16,16 @@
23 #include <libipset/ipset.h> /* ipset library */
24 #include <libipset/xlate.h> /* translate to nftables */
25
26+/* basename is implemented differently across different C libraries. This
27+ * implementation matches the one provided by the GNU libc, and does not
28+ * modify its input parameter.
29+ */
30+static const char *ipset_basename(const char *path)
31+{
32+ const char *base = strrchr(path, '/');
33+ return base ? base + 1 : path;
34+}
35+
36 int
37 main(int argc, char *argv[])
38 {
39@@ -32,7 +42,7 @@ main(int argc, char *argv[])
40 exit(1);
41 }
42
43- if (!strcmp(basename(argv[0]), "ipset-translate")) {
44+ if (!strcmp(ipset_basename(argv[0]), "ipset-translate")) {
45 ret = ipset_xlate_argv(ipset, argc, argv);
46 } else {
47 ret = ipset_parse_argv(ipset, argc, argv);
48--
492.44.0
50
diff --git a/meta-networking/recipes-filter/ipset/ipset_7.19.bb b/meta-networking/recipes-filter/ipset/ipset_7.21.bb
index bb4319f36..c7ebdc1c6 100644
--- a/meta-networking/recipes-filter/ipset/ipset_7.19.bb
+++ b/meta-networking/recipes-filter/ipset/ipset_7.21.bb
@@ -9,8 +9,9 @@ SECTION = "base"
9 9
10DEPENDS = "libtool libmnl" 10DEPENDS = "libtool libmnl"
11 11
12SRC_URI = "http://ftp.netfilter.org/pub/ipset/${BP}.tar.bz2" 12SRC_URI = "http://ftp.netfilter.org/pub/ipset/${BP}.tar.bz2 \
13SRC_URI[sha256sum] = "9bc1fba48d65786e3e0b63dc6b669a866823d77840c6990c0c6b23078ec2c4d6" 13 file://0001-ipset-Define-portable-basename-function.patch"
14SRC_URI[sha256sum] = "e2c6ce4fcf3acb3893ca5d35c86935f80ad76fc5ccae601185842df760e0bc69"
14 15
15inherit autotools pkgconfig module-base 16inherit autotools pkgconfig module-base
16 17