From a221b0566e53b66f7fba85d9a8740e2e1b5429f6 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 18 May 2022 12:57:59 +0200 Subject: iptables: upgrade 1.8.7 -> 1.8.8 (From OE-Core rev: b44d6bc7e56121d977a7bc491aec00cf3fb510fb) Signed-off-by: Alexander Kanavin Signed-off-by: Luca Ceresoli Signed-off-by: Richard Purdie --- ...xshared.h-add-missing-sys.types.h-include.patch | 30 +++++ .../iptables/iptables/format-security.patch | 30 +++++ meta/recipes-extended/iptables/iptables_1.8.7.bb | 116 ------------------- meta/recipes-extended/iptables/iptables_1.8.8.bb | 123 +++++++++++++++++++++ 4 files changed, 183 insertions(+), 116 deletions(-) create mode 100644 meta/recipes-extended/iptables/iptables/0001-iptables-xshared.h-add-missing-sys.types.h-include.patch create mode 100644 meta/recipes-extended/iptables/iptables/format-security.patch delete mode 100644 meta/recipes-extended/iptables/iptables_1.8.7.bb create mode 100644 meta/recipes-extended/iptables/iptables_1.8.8.bb (limited to 'meta/recipes-extended') diff --git a/meta/recipes-extended/iptables/iptables/0001-iptables-xshared.h-add-missing-sys.types.h-include.patch b/meta/recipes-extended/iptables/iptables/0001-iptables-xshared.h-add-missing-sys.types.h-include.patch new file mode 100644 index 0000000000..17dd032434 --- /dev/null +++ b/meta/recipes-extended/iptables/iptables/0001-iptables-xshared.h-add-missing-sys.types.h-include.patch @@ -0,0 +1,30 @@ +From 796b8f6fc1e584c27c42ba302f623fd1c5aa0667 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 17 May 2022 10:56:59 +0200 +Subject: [PATCH] iptables/xshared.h: add missing sys.types.h include + +This resolves the build error under musl: + +| ../../../../../../../workspace/sources/iptables/iptables/xshared.h:83:56: error: unknown type name 'u_int16_t'; did you mean 'uint16_t'? +| 83 | set_option(unsigned int *options, unsigned int option, u_int16_t *invflg, +| | ^~~~~~~~~ +| | uint16_t + +Upstream-Status: Submitted [via email to phil@nwl.cc] +Signed-off-by: Alexander Kanavin +--- + iptables/xshared.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/iptables/xshared.h b/iptables/xshared.h +index 14568bb..73b1017 100644 +--- a/iptables/xshared.h ++++ b/iptables/xshared.h +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/meta/recipes-extended/iptables/iptables/format-security.patch b/meta/recipes-extended/iptables/iptables/format-security.patch new file mode 100644 index 0000000000..be1e077b49 --- /dev/null +++ b/meta/recipes-extended/iptables/iptables/format-security.patch @@ -0,0 +1,30 @@ +From b72eb12ea5a61df0655ad99d5048994e916be83a Mon Sep 17 00:00:00 2001 +From: Phil Sutter +Date: Fri, 13 May 2022 16:51:58 +0200 +Subject: xshared: Fix build for -Werror=format-security + +Gcc complains about the omitted format string. + +Signed-off-by: Phil Sutter +Upstream-Status: Backport +Signed-off-by: Alexander Kanavin +--- + iptables/xshared.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/iptables/xshared.c b/iptables/xshared.c +index fae5ddd5..a8512d38 100644 +--- a/iptables/xshared.c ++++ b/iptables/xshared.c +@@ -1307,7 +1307,7 @@ static void check_empty_interface(struct xtables_args *args, const char *arg) + return; + + if (args->family != NFPROTO_ARP) +- xtables_error(PARAMETER_PROBLEM, msg); ++ xtables_error(PARAMETER_PROBLEM, "%s", msg); + + fprintf(stderr, "%s", msg); + } +-- +cgit v1.2.3 + diff --git a/meta/recipes-extended/iptables/iptables_1.8.7.bb b/meta/recipes-extended/iptables/iptables_1.8.7.bb deleted file mode 100644 index 3b41882841..0000000000 --- a/meta/recipes-extended/iptables/iptables_1.8.7.bb +++ /dev/null @@ -1,116 +0,0 @@ -SUMMARY = "Tools for managing kernel packet filtering capabilities" -DESCRIPTION = "iptables is the userspace command line program used to configure and control network packet \ -filtering code in Linux." -HOMEPAGE = "http://www.netfilter.org/" -BUGTRACKER = "http://bugzilla.netfilter.org/" -LICENSE = "GPL-2.0-or-later" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ - file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc \ -" - -SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \ - file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \ - file://0001-Makefile.am-do-not-install-etc-ethertypes.patch \ - file://0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch \ - file://iptables.service \ - file://iptables.rules \ - file://ip6tables.service \ - file://ip6tables.rules \ - " -SRC_URI[sha256sum] = "c109c96bb04998cd44156622d36f8e04b140701ec60531a10668cfdff5e8d8f0" - -SYSTEMD_SERVICE:${PN} = "\ - iptables.service \ - ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', 'ip6tables.service', '', d)} \ -" - -inherit autotools pkgconfig systemd - -EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR}" - -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" -PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," - -# libnfnetlink recipe is in meta-networking layer -PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--disable-libnfnetlink,libnfnetlink libnetfilter-conntrack" - -# libnftnl recipe is in meta-networking layer(previously known as libnftables) -PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl" - -do_configure:prepend() { - # Remove some libtool m4 files - # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive. - rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 -} - -IPTABLES_RULES_DIR ?= "${sysconfdir}/${BPN}" - -do_install:append() { - install -d ${D}${IPTABLES_RULES_DIR} - install -m 0644 ${WORKDIR}/iptables.rules ${D}${IPTABLES_RULES_DIR} - - install -d ${D}${systemd_system_unitdir} - install -m 0644 ${WORKDIR}/iptables.service ${D}${systemd_system_unitdir} - - sed -i \ - -e 's,@SBINDIR@,${sbindir},g' \ - -e 's,@RULESDIR@,${IPTABLES_RULES_DIR},g' \ - ${D}${systemd_system_unitdir}/iptables.service - - if ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', 'true', 'false', d)} ; then - install -m 0644 ${WORKDIR}/ip6tables.rules ${D}${IPTABLES_RULES_DIR} - install -m 0644 ${WORKDIR}/ip6tables.service ${D}${systemd_system_unitdir} - - sed -i \ - -e 's,@SBINDIR@,${sbindir},g' \ - -e 's,@RULESDIR@,${IPTABLES_RULES_DIR},g' \ - ${D}${systemd_system_unitdir}/ip6tables.service - fi - - # if libnftnl is included, make the iptables symlink point to the nft-based binary by default - if ${@bb.utils.contains('PACKAGECONFIG', 'libnftnl', 'true', 'false', d)} ; then - ln -sf ${sbindir}/xtables-nft-multi ${D}${sbindir}/iptables - fi -} - -PACKAGES =+ "${PN}-modules ${PN}-apply" -PACKAGES_DYNAMIC += "^${PN}-module-.*" - -python populate_packages:prepend() { - modules = do_split_packages(d, '${libdir}/xtables', r'lib(.*)\.so$', '${PN}-module-%s', '${PN} module %s', extra_depends='') - if modules: - metapkg = d.getVar('PN') + '-modules' - d.appendVar('RDEPENDS:' + metapkg, ' ' + ' '.join(modules)) -} - -RDEPENDS:${PN} = "${PN}-module-xt-standard" -RRECOMMENDS:${PN} = " \ - ${PN}-modules \ - kernel-module-x-tables \ - kernel-module-ip-tables \ - kernel-module-iptable-filter \ - kernel-module-iptable-nat \ - kernel-module-nf-defrag-ipv4 \ - kernel-module-nf-conntrack \ - kernel-module-nf-conntrack-ipv4 \ - kernel-module-nf-nat \ - kernel-module-ipt-masquerade \ - ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', '\ - kernel-module-ip6table-filter \ - kernel-module-ip6-tables \ - ', '', d)} \ -" - -FILES:${PN} += "${datadir}/xtables" - -FILES:${PN}-apply = "${sbindir}/ip*-apply" -RDEPENDS:${PN}-apply = "${PN} bash" - -# Include the symlinks as well in respective packages -FILES:${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so" -FILES:${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so" - -ALLOW_EMPTY:${PN}-modules = "1" - -INSANE_SKIP:${PN}-module-xt-conntrack = "dev-so" -INSANE_SKIP:${PN}-module-xt-ct = "dev-so" diff --git a/meta/recipes-extended/iptables/iptables_1.8.8.bb b/meta/recipes-extended/iptables/iptables_1.8.8.bb new file mode 100644 index 0000000000..54d027220b --- /dev/null +++ b/meta/recipes-extended/iptables/iptables_1.8.8.bb @@ -0,0 +1,123 @@ +SUMMARY = "Tools for managing kernel packet filtering capabilities" +DESCRIPTION = "iptables is the userspace command line program used to configure and control network packet \ +filtering code in Linux." +HOMEPAGE = "http://www.netfilter.org/" +BUGTRACKER = "http://bugzilla.netfilter.org/" +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc \ +" + +SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \ + file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \ + file://0001-Makefile.am-do-not-install-etc-ethertypes.patch \ + file://0002-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch \ + file://format-security.patch \ + file://iptables.service \ + file://iptables.rules \ + file://ip6tables.service \ + file://ip6tables.rules \ + file://0001-iptables-xshared.h-add-missing-sys.types.h-include.patch \ + " +SRC_URI[sha256sum] = "71c75889dc710676631553eb1511da0177bbaaf1b551265b912d236c3f51859f" + +SYSTEMD_SERVICE:${PN} = "\ + iptables.service \ + ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', 'ip6tables.service', '', d)} \ +" + +inherit autotools pkgconfig systemd + +EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR}" + +CFLAGS:append:libc-musl = " -D__UAPI_DEF_ETHHDR=0" + +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" +PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," + +# libnfnetlink recipe is in meta-networking layer +PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--disable-libnfnetlink,libnfnetlink libnetfilter-conntrack" + +# libnftnl recipe is in meta-networking layer(previously known as libnftables) +PACKAGECONFIG[libnftnl] = "--enable-nftables,--disable-nftables,libnftnl" + +do_configure:prepend() { + # Remove some libtool m4 files + # Keep ax_check_linker_flags.m4 which belongs to autoconf-archive. + rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 + + # Copy a header to fix out of tree builds + cp -f ${S}/libiptc/linux_list.h ${S}/include/libiptc/ +} + +IPTABLES_RULES_DIR ?= "${sysconfdir}/${BPN}" + +do_install:append() { + install -d ${D}${IPTABLES_RULES_DIR} + install -m 0644 ${WORKDIR}/iptables.rules ${D}${IPTABLES_RULES_DIR} + + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/iptables.service ${D}${systemd_system_unitdir} + + sed -i \ + -e 's,@SBINDIR@,${sbindir},g' \ + -e 's,@RULESDIR@,${IPTABLES_RULES_DIR},g' \ + ${D}${systemd_system_unitdir}/iptables.service + + if ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', 'true', 'false', d)} ; then + install -m 0644 ${WORKDIR}/ip6tables.rules ${D}${IPTABLES_RULES_DIR} + install -m 0644 ${WORKDIR}/ip6tables.service ${D}${systemd_system_unitdir} + + sed -i \ + -e 's,@SBINDIR@,${sbindir},g' \ + -e 's,@RULESDIR@,${IPTABLES_RULES_DIR},g' \ + ${D}${systemd_system_unitdir}/ip6tables.service + fi + + # if libnftnl is included, make the iptables symlink point to the nft-based binary by default + if ${@bb.utils.contains('PACKAGECONFIG', 'libnftnl', 'true', 'false', d)} ; then + ln -sf ${sbindir}/xtables-nft-multi ${D}${sbindir}/iptables + fi +} + +PACKAGES =+ "${PN}-modules ${PN}-apply" +PACKAGES_DYNAMIC += "^${PN}-module-.*" + +python populate_packages:prepend() { + modules = do_split_packages(d, '${libdir}/xtables', r'lib(.*)\.so$', '${PN}-module-%s', '${PN} module %s', extra_depends='') + if modules: + metapkg = d.getVar('PN') + '-modules' + d.appendVar('RDEPENDS:' + metapkg, ' ' + ' '.join(modules)) +} + +RDEPENDS:${PN} = "${PN}-module-xt-standard" +RRECOMMENDS:${PN} = " \ + ${PN}-modules \ + kernel-module-x-tables \ + kernel-module-ip-tables \ + kernel-module-iptable-filter \ + kernel-module-iptable-nat \ + kernel-module-nf-defrag-ipv4 \ + kernel-module-nf-conntrack \ + kernel-module-nf-conntrack-ipv4 \ + kernel-module-nf-nat \ + kernel-module-ipt-masquerade \ + ${@bb.utils.contains('PACKAGECONFIG', 'ipv6', '\ + kernel-module-ip6table-filter \ + kernel-module-ip6-tables \ + ', '', d)} \ +" + +FILES:${PN} += "${datadir}/xtables" + +FILES:${PN}-apply = "${sbindir}/ip*-apply" +RDEPENDS:${PN}-apply = "${PN} bash" + +# Include the symlinks as well in respective packages +FILES:${PN}-module-xt-conntrack += "${libdir}/xtables/libxt_state.so" +FILES:${PN}-module-xt-ct += "${libdir}/xtables/libxt_NOTRACK.so ${libdir}/xtables/libxt_REDIRECT.so" + +ALLOW_EMPTY:${PN}-modules = "1" + +INSANE_SKIP:${PN}-module-xt-conntrack = "dev-so" +INSANE_SKIP:${PN}-module-xt-ct = "dev-so" -- cgit v1.2.3-54-g00ecf