diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-03-24 22:04:03 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-03-24 22:52:26 -0700 |
commit | ccff89588a5f4fa58a47f6970c6a2b1f20f06a8a (patch) | |
tree | b658ee0013a9d73681eed5190be54af5e25c62e2 /meta-networking/recipes-filter/ipset/ipset | |
parent | 742c3da8747b291e9624fc83948d5dc3ba04a33e (diff) | |
download | meta-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>
Diffstat (limited to 'meta-networking/recipes-filter/ipset/ipset')
-rw-r--r-- | meta-networking/recipes-filter/ipset/ipset/0001-ipset-Define-portable-basename-function.patch | 50 |
1 files changed, 50 insertions, 0 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 @@ | |||
1 | From 8c5c0a7a48af7652c50bc27a4efdd9cb4f7d95bd Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 24 Mar 2024 21:58:50 -0700 | ||
4 | Subject: [PATCH] ipset: Define portable basename function | ||
5 | |||
6 | Newer version of musl have removed prototype for basename in string.h [1] | ||
7 | which now makes it fail to compile with newer clang 18+ compiler therefore | ||
8 | define 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 | |||
12 | Upstream-Status: Pending | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | src/ipset.c | 12 +++++++++++- | ||
16 | 1 file changed, 11 insertions(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/src/ipset.c b/src/ipset.c | ||
19 | index 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 | -- | ||
49 | 2.44.0 | ||
50 | |||