From 4e2920fc0885d766519295cf7d3b84af589d7489 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Mon, 22 Jun 2026 08:08:35 +0000 Subject: [PATCH] package: nftables: replace patch with proper backport A patch was added without proper header and not obvious that it's a backport. Replace that patch with a backport of the upstream commit. Patch 001-build-simplify-the-instantiation-of-nftversion-h.patch rebased, all others refreshed. Fixes: 255f4c8e60 ("packages: nftables: fix build on host with busybox ash") Link: https://github.com/openwrt/openwrt/pull/23910 Signed-off-by: Jonas Jelonek --- package/network/utils/nftables/Makefile | 2 +- ...ld-fix-configure-with-non-bash-shell.patch | 29 +++++++++++++++++++ ...fy-the-instantiation-of-nftversion-h.patch | 13 +++------ .../patches/001-for-bash-syntax.patch | 11 ------- ...e-build-time-stamp-once-at-configure.patch | 8 +---- ...URCE_DATE_EPOCH-for-build-time-stamp.patch | 4 +-- 6 files changed, 36 insertions(+), 31 deletions(-) create mode 100644 package/network/utils/nftables/patches/000-build-fix-configure-with-non-bash-shell.patch delete mode 100644 package/network/utils/nftables/patches/001-for-bash-syntax.patch diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index fbcf77e5546..6075ebb5af9 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables PKG_VERSION:=1.1.6 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files diff --git a/package/network/utils/nftables/patches/000-build-fix-configure-with-non-bash-shell.patch b/package/network/utils/nftables/patches/000-build-fix-configure-with-non-bash-shell.patch new file mode 100644 index 00000000000..03c2d4809b1 --- /dev/null +++ b/package/network/utils/nftables/patches/000-build-fix-configure-with-non-bash-shell.patch @@ -0,0 +1,29 @@ +From 2e3c68f26d5bd60c8ea7467fa9018c282a7d8c47 Mon Sep 17 00:00:00 2001 +From: Jan Palus +Date: Sat, 6 Dec 2025 00:43:58 +0100 +Subject: build: fix ./configure with non-bash shell + + CONFIG_SHELL=/bin/dash ./configure + +breaks with: + + ./config.status: 2044: Syntax error: Bad for loop variable + +Fixes: 64c07e38f049 ("table: Embed creating nft version into userdata") +Signed-off-by: Jan Palus +Signed-off-by: Pablo Neira Ayuso +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/configure.ac ++++ b/configure.ac +@@ -157,7 +157,7 @@ AC_CONFIG_COMMANDS([nftversion.h], [ + echo " ${STABLE_RELEASE}" + echo "};" + echo "static char nftbuildstamp[[]] = {" +- for ((i = 56; i >= 0; i-= 8)); do ++ for i in `seq 56 -8 0`; do + echo " ((uint64_t)MAKE_STAMP >> $i) & 0xff," + done + echo "};" diff --git a/package/network/utils/nftables/patches/001-build-simplify-the-instantiation-of-nftversion-h.patch b/package/network/utils/nftables/patches/001-build-simplify-the-instantiation-of-nftversion-h.patch index 64ca9b228d9..933c0b599aa 100644 --- a/package/network/utils/nftables/patches/001-build-simplify-the-instantiation-of-nftversion-h.patch +++ b/package/network/utils/nftables/patches/001-build-simplify-the-instantiation-of-nftversion-h.patch @@ -1,7 +1,7 @@ From 2a0ec8a7246e5c5eb85270e3d4de43e20a00c577 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Wed, 28 Jan 2026 18:31:05 +0000 -Subject: [PATCH] build: simplify the instantation of nftversion.h +Subject: build: simplify the instantation of nftversion.h Add an nftversion.h.in autoconf input file which configure uses to instantiate nftversion.h in the usual way. @@ -14,11 +14,9 @@ Signed-off-by: Phil Sutter 2 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 nftversion.h.in -diff --git a/configure.ac b/configure.ac -index 6825474..2c61072 100644 --- a/configure.ac +++ b/configure.ac -@@ -147,22 +147,8 @@ AM_CONDITIONAL([BUILD_SERVICE], [test "x$unitdir" != x]) +@@ -147,22 +147,8 @@ AM_CONDITIONAL([BUILD_SERVICE], [test "x AC_ARG_WITH([stable-release], [AS_HELP_STRING([--with-stable-release], [Stable release number])], [], [with_stable_release=0]) @@ -32,7 +30,7 @@ index 6825474..2c61072 100644 - echo " ${STABLE_RELEASE}" - echo "};" - echo "static char nftbuildstamp[[]] = {" -- for ((i = 56; i >= 0; i-= 8)); do +- for i in `seq 56 -8 0`; do - echo " ((uint64_t)MAKE_STAMP >> $i) & 0xff," - done - echo "};" @@ -43,7 +41,7 @@ index 6825474..2c61072 100644 # Current date should be fetched exactly once per build, # so have 'make' call date and pass the value to every 'gcc' call AC_SUBST([MAKE_STAMP], ["\$(shell date +%s)"]) -@@ -175,6 +161,7 @@ AM_CONDITIONAL([BUILD_DISTCHECK], [test "x$enable_distcheck" = "xyes"]) +@@ -175,6 +161,7 @@ AM_CONDITIONAL([BUILD_DISTCHECK], [test AC_CONFIG_FILES([ \ Makefile \ libnftables.pc \ @@ -51,9 +49,6 @@ index 6825474..2c61072 100644 ]) AC_OUTPUT -diff --git a/nftversion.h.in b/nftversion.h.in -new file mode 100644 -index 0000000..6f89771 --- /dev/null +++ b/nftversion.h.in @@ -0,0 +1,19 @@ diff --git a/package/network/utils/nftables/patches/001-for-bash-syntax.patch b/package/network/utils/nftables/patches/001-for-bash-syntax.patch deleted file mode 100644 index 8db917b5d6e..00000000000 --- a/package/network/utils/nftables/patches/001-for-bash-syntax.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/configure -+++ b/configure -@@ -17940,7 +17940,7 @@ - echo " ${STABLE_RELEASE}" - echo "};" - echo "static char nftbuildstamp[] = {" -- for ((i = 56; i >= 0; i-= 8)); do -+ for i in `seq 56 -8 0`; do - echo " ((uint64_t)MAKE_STAMP >> $i) & 0xff," - done - echo "};" diff --git a/package/network/utils/nftables/patches/002-build-generate-build-time-stamp-once-at-configure.patch b/package/network/utils/nftables/patches/002-build-generate-build-time-stamp-once-at-configure.patch index eae6a5bc073..82b19b1dbcd 100644 --- a/package/network/utils/nftables/patches/002-build-generate-build-time-stamp-once-at-configure.patch +++ b/package/network/utils/nftables/patches/002-build-generate-build-time-stamp-once-at-configure.patch @@ -19,8 +19,6 @@ Signed-off-by: Phil Sutter nftversion.h.in | 18 ++++++++++-------- 3 files changed, 11 insertions(+), 13 deletions(-) -diff --git a/Makefile.am b/Makefile.am -index b134330..ceb2225 100644 --- a/Makefile.am +++ b/Makefile.am @@ -159,8 +159,6 @@ AM_CFLAGS = \ @@ -32,11 +30,9 @@ index b134330..ceb2225 100644 $(NULL) AM_YFLAGS = -d -Wno-yacc -diff --git a/configure.ac b/configure.ac -index 2c61072..9859072 100644 --- a/configure.ac +++ b/configure.ac -@@ -149,9 +149,7 @@ AC_ARG_WITH([stable-release], [AS_HELP_STRING([--with-stable-release], +@@ -149,9 +149,7 @@ AC_ARG_WITH([stable-release], [AS_HELP_S [], [with_stable_release=0]) AC_SUBST([STABLE_RELEASE],[$with_stable_release]) AC_SUBST([NFT_VERSION], [$(echo "${VERSION}" | tr '.' ',')]) @@ -47,8 +43,6 @@ index 2c61072..9859072 100644 AC_ARG_ENABLE([distcheck], AS_HELP_STRING([--enable-distcheck], [Build for distcheck]), -diff --git a/nftversion.h.in b/nftversion.h.in -index 6f89771..325b9dc 100644 --- a/nftversion.h.in +++ b/nftversion.h.in @@ -1,19 +1,21 @@ diff --git a/package/network/utils/nftables/patches/003-build-support-SOURCE_DATE_EPOCH-for-build-time-stamp.patch b/package/network/utils/nftables/patches/003-build-support-SOURCE_DATE_EPOCH-for-build-time-stamp.patch index c37c77b7d24..83b014c7dac 100644 --- a/package/network/utils/nftables/patches/003-build-support-SOURCE_DATE_EPOCH-for-build-time-stamp.patch +++ b/package/network/utils/nftables/patches/003-build-support-SOURCE_DATE_EPOCH-for-build-time-stamp.patch @@ -18,11 +18,9 @@ Signed-off-by: Phil Sutter configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/configure.ac b/configure.ac -index 9859072..0226086 100644 --- a/configure.ac +++ b/configure.ac -@@ -149,7 +149,7 @@ AC_ARG_WITH([stable-release], [AS_HELP_STRING([--with-stable-release], +@@ -149,7 +149,7 @@ AC_ARG_WITH([stable-release], [AS_HELP_S [], [with_stable_release=0]) AC_SUBST([STABLE_RELEASE],[$with_stable_release]) AC_SUBST([NFT_VERSION], [$(echo "${VERSION}" | tr '.' ',')]) -- 2.47.3