Skip to content

Commit 7224134

Browse files
committed
xtables-addons: bump 3.30 and fix LUA build on 6.18
This upstream release allows clean builds against linux 6.18. Fix LUA PacketScript build on 6.18 by switching to ccflags-y and restoring the required -isystem include path. Remove compat_xtables since the module no longer exists in 3.30 and drop all dependent kmod references. Fix CI build failure with backport: 600-xt_pknock-fox-do_div-signness-mismatch.patch Note that upstream tarball changed from xz to zst. Signed-off-by: John Audia <therealgraysky@proton.me>
1 parent c410b89 commit 7224134

File tree

5 files changed

+102
-71
lines changed

5 files changed

+102
-71
lines changed

net/xtables-addons/Makefile

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk
77
include $(INCLUDE_DIR)/kernel.mk
88

99
PKG_NAME:=xtables-addons
10-
PKG_VERSION:=3.27
11-
PKG_RELEASE:=3
12-
PKG_HASH:=e47ea8febe73c12ecab09d2c93578c5dc72d76f17fdf673397758f519cce6828
10+
PKG_VERSION:=3.30
11+
PKG_RELEASE:=1
12+
PKG_HASH:=d43400322980390180bef05eb6f798af49285987c217b7f1c6332da74920d9a4
1313

14-
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
14+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.zst
1515
PKG_SOURCE_URL:=https://inai.de/files/xtables-addons/
1616
PKG_BUILD_DEPENDS:=iptables
1717

@@ -205,32 +205,29 @@ define KernelPackage/nf-nathelper-rtsp
205205
endef
206206

207207

208-
#$(eval $(call BuildTemplate,SUFFIX,DESCRIPTION,EXTENSION,MODULE,DEPENDS))
209-
210-
$(eval $(call BuildTemplate,compat-xtables,API compatibility layer,,compat_xtables,+IPV6:kmod-ip6tables))
211-
212-
$(eval $(call BuildTemplate,account,ACCOUNT,xt_ACCOUNT,ACCOUNT/xt_ACCOUNT,+kmod-ipt-compat-xtables))
208+
# compat_xtables removed (module no longer exists in 3.30)
209+
$(eval $(call BuildTemplate,account,ACCOUNT,xt_ACCOUNT,ACCOUNT/xt_ACCOUNT,))
213210
$(eval $(call BuildTemplate,asn,asn,xt_asn,xt_asn,))
214-
$(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,xt_CHAOS,+kmod-ipt-compat-xtables +kmod-ipt-delude +kmod-ipt-tarpit))
211+
$(eval $(call BuildTemplate,chaos,CHAOS,xt_CHAOS,xt_CHAOS,+kmod-ipt-delude +kmod-ipt-tarpit))
215212
$(eval $(call BuildTemplate,condition,Condition,xt_condition,xt_condition,))
216-
$(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,xt_DELUDE,+kmod-ipt-compat-xtables))
217-
$(eval $(call BuildTemplate,dhcpmac,DHCPMAC,xt_DHCPMAC,xt_DHCPMAC,+kmod-ipt-compat-xtables))
218-
$(eval $(call BuildTemplate,dnetmap,DNETMAP,xt_DNETMAP,xt_DNETMAP,+kmod-ipt-compat-xtables +kmod-ipt-nat))
213+
$(eval $(call BuildTemplate,delude,DELUDE,xt_DELUDE,xt_DELUDE,))
214+
$(eval $(call BuildTemplate,dhcpmac,DHCPMAC,xt_DHCPMAC,xt_DHCPMAC,))
215+
$(eval $(call BuildTemplate,dnetmap,DNETMAP,xt_DNETMAP,xt_DNETMAP,+kmod-ipt-nat))
219216
$(eval $(call BuildTemplate,fuzzy,fuzzy,xt_fuzzy,xt_fuzzy,))
220217
$(eval $(call BuildTemplate,geoip,geoip,xt_geoip,xt_geoip,))
221218
$(eval $(call BuildTemplate,iface,iface,xt_iface,xt_iface,))
222-
$(eval $(call BuildTemplate,ipmark,IPMARK,xt_IPMARK,xt_IPMARK,+kmod-ipt-compat-xtables))
223-
$(eval $(call BuildTemplate,ipp2p,IPP2P,xt_ipp2p,xt_ipp2p,+kmod-ipt-compat-xtables +kmod-lib-textsearch))
219+
$(eval $(call BuildTemplate,ipmark,IPMARK,xt_IPMARK,xt_IPMARK,))
220+
$(eval $(call BuildTemplate,ipp2p,IPP2P,xt_ipp2p,xt_ipp2p,+kmod-lib-textsearch))
224221
$(eval $(call BuildTemplate,ipv4options,ipv4options,xt_ipv4options,xt_ipv4options,))
225-
$(eval $(call BuildTemplate,length2,length2,xt_length2,xt_length2,+kmod-ipt-compat-xtables))
226-
$(eval $(call BuildTemplate,logmark,LOGMARK,xt_LOGMARK,xt_LOGMARK,+kmod-ipt-compat-xtables))
222+
$(eval $(call BuildTemplate,length2,length2,xt_length2,xt_length2,))
223+
$(eval $(call BuildTemplate,logmark,LOGMARK,xt_LOGMARK,xt_LOGMARK,))
227224
$(eval $(call BuildTemplate,lscan,lscan,xt_lscan,xt_lscan,))
228225
$(eval $(call BuildTemplate,lua,Lua PacketScript,xt_LUA,LUA/xt_LUA,+kmod-ipt-conntrack-extra))
229226
$(eval $(call BuildTemplate,proto,PROTO,xt_PROTO,xt_PROTO,))
230227
$(eval $(call BuildTemplate,psd,psd,xt_psd,xt_psd,))
231228
$(eval $(call BuildTemplate,quota2,quota2,xt_quota2,xt_quota2,))
232-
$(eval $(call BuildTemplate,sysrq,SYSRQ,xt_SYSRQ,xt_SYSRQ,+kmod-ipt-compat-xtables +kmod-crypto-hash))
233-
$(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,+kmod-ipt-compat-xtables))
229+
$(eval $(call BuildTemplate,sysrq,SYSRQ,xt_SYSRQ,xt_SYSRQ,+kmod-crypto-hash))
230+
$(eval $(call BuildTemplate,tarpit,TARPIT,xt_TARPIT,xt_TARPIT,))
234231

235232
$(eval $(call BuildPackage,iptaccount))
236233
$(eval $(call BuildPackage,iptasn))

net/xtables-addons/patches/100-add-rtsp-conntrack.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,7 @@
17371737
-include ${M}/Kbuild.*
17381738
--- a/mconfig
17391739
+++ b/mconfig
1740-
@@ -24,3 +24,4 @@ build_lscan=m
1740+
@@ -26,3 +26,4 @@ build_lscan=m
17411741
build_pknock=m
17421742
build_psd=m
17431743
build_quota2=m

net/xtables-addons/patches/200-add-lua-packetscript.patch

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,58 +1038,61 @@
10381038
+#endif /* CONTROLLER_H_ */
10391039
--- /dev/null
10401040
+++ b/extensions/LUA/Kbuild
1041-
@@ -0,0 +1,51 @@
1041+
@@ -0,0 +1,54 @@
10421042
+# -*- Makefile -*-
10431043
+
10441044
+# Adding debug options
1045-
+EXTRA_CFLAGS += -DDEBUG
1045+
+ccflags-y += -DDEBUG
10461046
+
10471047
+obj-m += xt_LUA.o
10481048
+
1049-
+EXTRA_CFLAGS += -I$(src)/prot_buf_new
1049+
+ccflags-y += -I$(src)/prot_buf_new
1050+
+
10501051
+xt_LUA-y += xt_LUA_target.o \
10511052
+
10521053
+xt_LUA-y += nf_lua.o \
1053-
+ prot_buf_helpers.o \
1054-
+ byte_array.o \
1055-
+ controller.o \
1056-
+ prot_buf_ethernet.o \
1057-
+ prot_buf_icmp.o \
1058-
+ prot_buf_ip.o \
1059-
+ prot_buf_raw.o \
1060-
+ prot_buf_tcp.o \
1061-
+ prot_buf_udp.o \
1062-
+ prot_buf_tftp.o \
1063-
+ prot_buf_dynamic.o \
1054+
+ prot_buf_helpers.o \
1055+
+ byte_array.o \
1056+
+ controller.o \
1057+
+ prot_buf_ethernet.o \
1058+
+ prot_buf_icmp.o \
1059+
+ prot_buf_ip.o \
1060+
+ prot_buf_raw.o \
1061+
+ prot_buf_tcp.o \
1062+
+ prot_buf_udp.o \
1063+
+ prot_buf_tftp.o \
1064+
+ prot_buf_dynamic.o \
10641065
+
10651066
+
10661067
+# Enable <stddef.h> <stdarg.h>
1067-
+EXTRA_CFLAGS += -isystem $(shell $(CC) -print-file-name=include)
1068-
+# Adding Lua Support
1069-
+EXTRA_CFLAGS += -I$(src)/lua -I$(src)/lua/include
1068+
+ccflags-y += -I$(src)/prot_buf_new
1069+
+# Adding Lua Support (embedded Lua and libc shims)
1070+
+ccflags-y += -I$(src)/lua -I$(src)/lua/include
1071+
+ccflags-y += -isystem $(shell $(CC) -print-file-name=include)
1072+
+
10701073
+xt_LUA-y += lua/lapi.o \
1071-
+ lua/lbaselib.o \
1072-
+ lua/lcode.o \
1073-
+ lua/ldebug.o \
1074-
+ lua/ldo.o \
1075-
+ lua/ldump.o \
1076-
+ lua/lfunc.o \
1077-
+ lua/lgc.o \
1078-
+ lua/llex.o \
1079-
+ lua/lmem.o \
1080-
+ lua/lobject.o \
1081-
+ lua/lopcodes.o \
1082-
+ lua/lparser.o \
1083-
+ lua/lstate.o \
1084-
+ lua/lstring.o \
1085-
+ lua/lstrlib.o \
1086-
+ lua/ltable.o \
1087-
+ lua/ltablib.o \
1088-
+ lua/ltm.o \
1089-
+ lua/lundump.o \
1090-
+ lua/lvm.o \
1091-
+ lua/lzio.o \
1092-
+ lua/lauxlib.o \
1074+
+ lua/lbaselib.o \
1075+
+ lua/lcode.o \
1076+
+ lua/ldebug.o \
1077+
+ lua/ldo.o \
1078+
+ lua/ldump.o \
1079+
+ lua/lfunc.o \
1080+
+ lua/lgc.o \
1081+
+ lua/llex.o \
1082+
+ lua/lmem.o \
1083+
+ lua/lobject.o \
1084+
+ lua/lopcodes.o \
1085+
+ lua/lparser.o \
1086+
+ lua/lstate.o \
1087+
+ lua/lstring.o \
1088+
+ lua/lstrlib.o \
1089+
+ lua/ltable.o \
1090+
+ lua/ltablib.o \
1091+
+ lua/ltm.o \
1092+
+ lua/lundump.o \
1093+
+ lua/lvm.o \
1094+
+ lua/lzio.o \
1095+
+ lua/lauxlib.o \
10931096
--- /dev/null
10941097
+++ b/extensions/LUA/libxt_LUA.c
10951098
@@ -0,0 +1,191 @@
@@ -18169,7 +18172,7 @@
1816918172
+obj-${build_LUA} += LUA/
1817018173
--- a/mconfig
1817118174
+++ b/mconfig
18172-
@@ -25,3 +25,4 @@ build_pknock=m
18175+
@@ -27,3 +27,4 @@ build_pknock=m
1817318176
build_psd=m
1817418177
build_quota2=m
1817518178
build_rtsp=m

net/xtables-addons/patches/300-fix-path-Makefile.extra.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 3c5c336fc0e47fea9baa912fc8d314ae9d1fa521 Mon Sep 17 00:00:00 2001
2+
From: Qingfang Deng <dqfext@gmail.com>
3+
Date: Mon, 29 Dec 2025 07:26:07 +0100
4+
Subject: [PATCH] xt_pknock: fix do_div() signness mismatch
5+
6+
do_div() expects an unsigned 64-bit dividend, but time64_t is signed. On
7+
32-bit arch, this triggers a warnning:
8+
9+
In file included from ./arch/arm/include/asm/div64.h:107,
10+
from ./include/linux/math.h:6,
11+
from ./include/linux/math64.h:6,
12+
from ./include/linux/time.h:6,
13+
from ./include/linux/stat.h:19,
14+
from ./include/linux/module.h:13,
15+
from ./xtables-addons-3.30/extensions/pknock/xt_pknock.c:10:
16+
./xtables-addons-3.30/extensions/pknock/xt_pknock.c: In function 'has_secret':
17+
./include/asm-generic/div64.h:222:35: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
18+
222 | (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
19+
| ^~
20+
./xtables-addons-3.30/extensions/pknock/xt_pknock.c:747:17: note: in expansion of macro 'do_div'
21+
747 | do_div(t, 60);
22+
|
23+
24+
Change the type of variable `t` to uint64_t to fix this.
25+
26+
Fixes: 397b282dba9a ("xt_pknock: use walltime for building hash")
27+
Signed-off-by: Qingfang Deng <dqfext@gmail.com>
28+
---
29+
extensions/pknock/xt_pknock.c | 2 +-
30+
1 file changed, 1 insertion(+), 1 deletion(-)
31+
32+
--- a/extensions/pknock/xt_pknock.c
33+
+++ b/extensions/pknock/xt_pknock.c
34+
@@ -743,7 +743,7 @@ has_secret(const unsigned char *secret,
35+
36+
/* Time needs to be in minutes relative to epoch. */
37+
{
38+
- time64_t t = ktime_get_real_seconds();
39+
+ uint64_t t = ktime_get_real_seconds();
40+
do_div(t, 60);
41+
epoch_min = t;
42+
}

0 commit comments

Comments
 (0)