From ccff89588a5f4fa58a47f6970c6a2b1f20f06a8a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 24 Mar 2024 22:04:03 -0700 Subject: ipset: Update to 7.21 Fix build with latest musl while here Signed-off-by: Khem Raj --- ...1-ipset-Define-portable-basename-function.patch | 50 ++++++++++++++++++++++ meta-networking/recipes-filter/ipset/ipset_7.19.bb | 21 --------- meta-networking/recipes-filter/ipset/ipset_7.21.bb | 22 ++++++++++ 3 files changed, 72 insertions(+), 21 deletions(-) create mode 100644 meta-networking/recipes-filter/ipset/ipset/0001-ipset-Define-portable-basename-function.patch delete mode 100644 meta-networking/recipes-filter/ipset/ipset_7.19.bb create mode 100644 meta-networking/recipes-filter/ipset/ipset_7.21.bb 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 @@ +From 8c5c0a7a48af7652c50bc27a4efdd9cb4f7d95bd Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 24 Mar 2024 21:58:50 -0700 +Subject: [PATCH] ipset: Define portable basename function + +Newer version of musl have removed prototype for basename in string.h [1] +which now makes it fail to compile with newer clang 18+ compiler therefore +define own basename utility function and not depend on platform for it. + +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + src/ipset.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/src/ipset.c b/src/ipset.c +index 162f477..7b5d580 100644 +--- a/src/ipset.c ++++ b/src/ipset.c +@@ -16,6 +16,16 @@ + #include /* ipset library */ + #include /* translate to nftables */ + ++/* basename is implemented differently across different C libraries. This ++ * implementation matches the one provided by the GNU libc, and does not ++ * modify its input parameter. ++ */ ++static const char *ipset_basename(const char *path) ++{ ++ const char *base = strrchr(path, '/'); ++ return base ? base + 1 : path; ++} ++ + int + main(int argc, char *argv[]) + { +@@ -32,7 +42,7 @@ main(int argc, char *argv[]) + exit(1); + } + +- if (!strcmp(basename(argv[0]), "ipset-translate")) { ++ if (!strcmp(ipset_basename(argv[0]), "ipset-translate")) { + ret = ipset_xlate_argv(ipset, argc, argv); + } else { + ret = ipset_parse_argv(ipset, argc, argv); +-- +2.44.0 + diff --git a/meta-networking/recipes-filter/ipset/ipset_7.19.bb b/meta-networking/recipes-filter/ipset/ipset_7.19.bb deleted file mode 100644 index bb4319f36..000000000 --- a/meta-networking/recipes-filter/ipset/ipset_7.19.bb +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (C) 2017 Aaron Brice -# Released under the MIT license (see COPYING.MIT for the terms) - -DESCRIPTION = "Administration tool for IP sets" -HOMEPAGE = "http://ipset.netfilter.org" -LICENSE = "GPL-2.0-only" -LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552" -SECTION = "base" - -DEPENDS = "libtool libmnl" - -SRC_URI = "http://ftp.netfilter.org/pub/ipset/${BP}.tar.bz2" -SRC_URI[sha256sum] = "9bc1fba48d65786e3e0b63dc6b669a866823d77840c6990c0c6b23078ec2c4d6" - -inherit autotools pkgconfig module-base - -EXTRA_OECONF += "-with-kbuild=${KBUILD_OUTPUT} --with-ksource=${STAGING_KERNEL_DIR}" - -RRECOMMENDS:${PN} = "\ - kernel-module-ip-set \ -" diff --git a/meta-networking/recipes-filter/ipset/ipset_7.21.bb b/meta-networking/recipes-filter/ipset/ipset_7.21.bb new file mode 100644 index 000000000..c7ebdc1c6 --- /dev/null +++ b/meta-networking/recipes-filter/ipset/ipset_7.21.bb @@ -0,0 +1,22 @@ +# Copyright (C) 2017 Aaron Brice +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "Administration tool for IP sets" +HOMEPAGE = "http://ipset.netfilter.org" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552" +SECTION = "base" + +DEPENDS = "libtool libmnl" + +SRC_URI = "http://ftp.netfilter.org/pub/ipset/${BP}.tar.bz2 \ + file://0001-ipset-Define-portable-basename-function.patch" +SRC_URI[sha256sum] = "e2c6ce4fcf3acb3893ca5d35c86935f80ad76fc5ccae601185842df760e0bc69" + +inherit autotools pkgconfig module-base + +EXTRA_OECONF += "-with-kbuild=${KBUILD_OUTPUT} --with-ksource=${STAGING_KERNEL_DIR}" + +RRECOMMENDS:${PN} = "\ + kernel-module-ip-set \ +" -- cgit v1.2.3-54-g00ecf