From 5171a2ec817a6826c7ceea829525fc9f99f0d8cd Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 17 Jan 2013 11:20:51 +0000 Subject: [PATCH] xtables-addons: update to v2.1, fix compilation against Linux 3.7.2, refresh patches SVN-Revision: 35192 --- net/xtables-addons/Makefile | 6 +- .../002-fix-kernel-version-detection.patch | 2 +- .../patches/100-add-rtsp-conntrack.patch | 4 +- .../patches/102-rtsp-linux-3.7-compat.patch | 32 +++---- .../patches/110-dnetmap-linux-3.7.patch | 22 ----- .../patches/200-add-lua-packetscript.patch | 6 +- .../400-uid-gid-linux-3.7-compat.patch | 83 +++++++++++++++++++ 7 files changed, 108 insertions(+), 47 deletions(-) delete mode 100644 net/xtables-addons/patches/110-dnetmap-linux-3.7.patch create mode 100644 net/xtables-addons/patches/400-uid-gid-linux-3.7-compat.patch diff --git a/net/xtables-addons/Makefile b/net/xtables-addons/Makefile index 9bf39dab4..2bac214eb 100644 --- a/net/xtables-addons/Makefile +++ b/net/xtables-addons/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2009-2012 OpenWrt.org +# Copyright (C) 2009-2013 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -10,9 +10,9 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=xtables-addons ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.7.0)),1) -PKG_VERSION:=2.0 +PKG_VERSION:=2.1 PKG_RELEASE:=1 -PKG_MD5SUM:=26b1b1dbb4a8faff24597723ebde04c9 +PKG_MD5SUM:=b624fc57bbda9e15c33a6471e4ec75e1 else PKG_VERSION:=1.45 PKG_RELEASE:=3 diff --git a/net/xtables-addons/patches/002-fix-kernel-version-detection.patch b/net/xtables-addons/patches/002-fix-kernel-version-detection.patch index b31f9f16c..8dc638447 100644 --- a/net/xtables-addons/patches/002-fix-kernel-version-detection.patch +++ b/net/xtables-addons/patches/002-fix-kernel-version-detection.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -11780,7 +11780,7 @@ regular_CFLAGS="-Wall -Waggregate-return +@@ -11892,7 +11892,7 @@ regular_CFLAGS="-Wall -Waggregate-return if test -n "$kbuilddir"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel version that we will build against" >&5 $as_echo_n "checking kernel version that we will build against... " >&6; } diff --git a/net/xtables-addons/patches/100-add-rtsp-conntrack.patch b/net/xtables-addons/patches/100-add-rtsp-conntrack.patch index 34cdc8c17..9e105b43a 100644 --- a/net/xtables-addons/patches/100-add-rtsp-conntrack.patch +++ b/net/xtables-addons/patches/100-add-rtsp-conntrack.patch @@ -1317,7 +1317,7 @@ +module_exit(fini); --- a/extensions/Kbuild +++ b/extensions/Kbuild -@@ -35,6 +35,7 @@ obj-${build_lscan} += xt_lscan.o +@@ -33,6 +33,7 @@ obj-${build_lscan} += xt_lscan.o obj-${build_pknock} += pknock/ obj-${build_psd} += xt_psd.o obj-${build_quota2} += xt_quota2.o @@ -1327,7 +1327,7 @@ -include ${M}/Kbuild.* --- a/mconfig +++ b/mconfig -@@ -26,3 +26,4 @@ build_lscan=m +@@ -24,3 +24,4 @@ build_lscan=m build_pknock=m build_psd=m build_quota2=m diff --git a/net/xtables-addons/patches/102-rtsp-linux-3.7-compat.patch b/net/xtables-addons/patches/102-rtsp-linux-3.7-compat.patch index 7fc37f789..0fe7917cf 100644 --- a/net/xtables-addons/patches/102-rtsp-linux-3.7-compat.patch +++ b/net/xtables-addons/patches/102-rtsp-linux-3.7-compat.patch @@ -1,5 +1,5 @@ ---- xtables-addons-2.0/extensions/rtsp/nf_conntrack_rtsp.c~ 2012-12-20 00:08:48.000000000 +0000 -+++ xtables-addons-2.0/extensions/rtsp/nf_conntrack_rtsp.c 2012-12-20 00:19:14.065730169 +0000 +--- a/extensions/rtsp/nf_conntrack_rtsp.c ++++ b/extensions/rtsp/nf_conntrack_rtsp.c @@ -73,7 +73,7 @@ static DEFINE_SPINLOCK(rtsp_buffer_lock) static struct nf_conntrack_expect_policy rtsp_exp_policy; @@ -36,8 +36,8 @@ break; case IP_CT_DIR_REPLY: pr_debug("IP_CT_DIR_REPLY\n"); ---- xtables-addons-2.0/extensions/rtsp/nf_conntrack_rtsp.h~ 2012-12-20 00:08:48.000000000 +0000 -+++ xtables-addons-2.0/extensions/rtsp/nf_conntrack_rtsp.h 2012-12-20 00:16:50.868733345 +0000 +--- a/extensions/rtsp/nf_conntrack_rtsp.h ++++ b/extensions/rtsp/nf_conntrack_rtsp.h @@ -50,6 +50,7 @@ struct ip_ct_rtsp_expect extern unsigned int (*nf_nat_rtsp_hook)(struct sk_buff *skb, @@ -46,9 +46,9 @@ unsigned int matchoff, unsigned int matchlen, struct ip_ct_rtsp_expect *prtspexp, struct nf_conntrack_expect *exp); ---- xtables-addons-2.0/extensions/rtsp/nf_nat_rtsp.c~ 2012-12-20 00:08:48.000000000 +0000 -+++ xtables-addons-2.0/extensions/rtsp/nf_nat_rtsp.c 2012-12-20 00:29:32.311738640 +0000 -@@ -33,10 +33,10 @@ +--- a/extensions/rtsp/nf_nat_rtsp.c ++++ b/extensions/rtsp/nf_nat_rtsp.c +@@ -32,10 +32,10 @@ #include #include @@ -61,7 +61,7 @@ #include #include -@@ -105,8 +103,8 @@ get_skb_tcpdata(struct sk_buff* skb, cha +@@ -102,8 +102,8 @@ get_skb_tcpdata(struct sk_buff* skb, cha static int rtsp_mangle_tran(enum ip_conntrack_info ctinfo, struct nf_conntrack_expect* exp, @@ -72,7 +72,7 @@ { char* ptcp; uint tcplen; -@@ -259,7 +257,7 @@ rtsp_mangle_tran(enum ip_conntrack_info +@@ -256,7 +256,7 @@ rtsp_mangle_tran(enum ip_conntrack_info if (dstact == DSTACT_STRIP || (dstact == DSTACT_AUTO && !is_stun)) { diff = nextfieldoff-off; @@ -81,7 +81,7 @@ off, diff, NULL, 0)) { /* mangle failed, all we can do is bail */ -@@ -329,7 +327,7 @@ rtsp_mangle_tran(enum ip_conntrack_info +@@ -326,7 +326,7 @@ rtsp_mangle_tran(enum ip_conntrack_info * parameter 4 below is offset from start of tcp data. */ diff = origlen-rbuflen; @@ -90,7 +90,7 @@ origoff, origlen, rbuf, rbuflen)) { /* mangle failed, all we can do is bail */ -@@ -354,7 +352,7 @@ rtsp_mangle_tran(enum ip_conntrack_info +@@ -351,7 +351,7 @@ rtsp_mangle_tran(enum ip_conntrack_info } static uint @@ -99,7 +99,7 @@ unsigned int matchoff, unsigned int matchlen, struct ip_ct_rtsp_expect* prtspexp, struct nf_conntrack_expect* exp) { -@@ -392,7 +390,7 @@ help_out(struct sk_buff *skb, enum ip_co +@@ -389,7 +389,7 @@ help_out(struct sk_buff *skb, enum ip_co { uint oldtcplen = tcplen; pr_debug("hdr: Transport\n"); @@ -108,7 +108,7 @@ { pr_debug("hdr: Transport mangle failed"); break; -@@ -410,7 +408,7 @@ help_out(struct sk_buff *skb, enum ip_co +@@ -407,7 +407,7 @@ help_out(struct sk_buff *skb, enum ip_co } static unsigned int @@ -117,7 +117,7 @@ unsigned int matchoff, unsigned int matchlen, struct ip_ct_rtsp_expect* prtspexp, struct nf_conntrack_expect* exp) { -@@ -420,7 +418,7 @@ help(struct sk_buff *skb, enum ip_conntr +@@ -417,7 +417,7 @@ help(struct sk_buff *skb, enum ip_conntr switch (dir) { case IP_CT_DIR_ORIGINAL: @@ -126,7 +126,7 @@ break; case IP_CT_DIR_REPLY: pr_debug("unmangle ! %u\n", ctinfo); -@@ -435,7 +433,7 @@ help(struct sk_buff *skb, enum ip_conntr +@@ -432,7 +432,7 @@ help(struct sk_buff *skb, enum ip_conntr static void expected(struct nf_conn* ct, struct nf_conntrack_expect *exp) { @@ -135,7 +135,7 @@ u_int32_t newdstip, newsrcip, newip; struct nf_conn *master = ct->master; -@@ -449,12 +447,13 @@ static void expected(struct nf_conn* ct, +@@ -446,12 +446,13 @@ static void expected(struct nf_conn* ct, pr_debug("newsrcip=%pI4, newdstip=%pI4, newip=%pI4\n", &newsrcip, &newdstip, &newip); diff --git a/net/xtables-addons/patches/110-dnetmap-linux-3.7.patch b/net/xtables-addons/patches/110-dnetmap-linux-3.7.patch deleted file mode 100644 index f0aa6d474..000000000 --- a/net/xtables-addons/patches/110-dnetmap-linux-3.7.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- xtables-addons-2.0/extensions/xt_DNETMAP.c~ 2012-11-12 18:03:51.000000000 +0000 -+++ xtables-addons-2.0/extensions/xt_DNETMAP.c 2012-12-20 00:06:10.656675731 +0000 -@@ -27,7 +27,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include ---- xtables-addons-2.0/mconfig 2012-12-20 00:55:11.445085492 +0000 -+++ xtables-addons-2.0/mconfig~ 2012-12-20 00:54:29.000000000 +0000 -@@ -4,7 +4,7 @@ build_ACCOUNT=m - build_CHAOS=m - build_DELUDE=m - build_DHCPMAC=m --build_DNETMAP= -+build_DNETMAP=m - build_ECHO=m - build_IPMARK=m - build_LOGMARK=m diff --git a/net/xtables-addons/patches/200-add-lua-packetscript.patch b/net/xtables-addons/patches/200-add-lua-packetscript.patch index 1717bf527..c2731b74a 100644 --- a/net/xtables-addons/patches/200-add-lua-packetscript.patch +++ b/net/xtables-addons/patches/200-add-lua-packetscript.patch @@ -18206,7 +18206,7 @@ + --- a/extensions/Kbuild +++ b/extensions/Kbuild -@@ -36,6 +36,7 @@ obj-${build_pknock} += pknock/ +@@ -34,6 +34,7 @@ obj-${build_pknock} += pknock/ obj-${build_psd} += xt_psd.o obj-${build_quota2} += xt_quota2.o obj-${build_rtsp} += rtsp/ @@ -18216,14 +18216,14 @@ -include ${M}/Kbuild.* --- a/extensions/Mbuild +++ b/extensions/Mbuild -@@ -26,3 +26,4 @@ obj-${build_pknock} += pknock/ +@@ -24,3 +24,4 @@ obj-${build_pknock} += pknock/ obj-${build_psd} += libxt_psd.so obj-${build_quota2} += libxt_quota2.so obj-${build_gradm} += libxt_gradm.so +obj-${build_LUA} += LUA/ --- a/mconfig +++ b/mconfig -@@ -27,3 +27,4 @@ build_pknock=m +@@ -25,3 +25,4 @@ build_pknock=m build_psd=m build_quota2=m build_rtsp=m diff --git a/net/xtables-addons/patches/400-uid-gid-linux-3.7-compat.patch b/net/xtables-addons/patches/400-uid-gid-linux-3.7-compat.patch new file mode 100644 index 000000000..1d9991a42 --- /dev/null +++ b/net/xtables-addons/patches/400-uid-gid-linux-3.7-compat.patch @@ -0,0 +1,83 @@ +--- a/extensions/xt_DNETMAP.c ++++ b/extensions/xt_DNETMAP.c +@@ -21,6 +21,7 @@ + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include + #include ++#include + #include + #include + #include +@@ -328,8 +329,8 @@ static int dnetmap_tg_check(const struct + ret = -ENOMEM; + goto out; + } +- pde_data->uid = proc_uid; +- pde_data->gid = proc_gid; ++ pde_data->uid = XT_UID(proc_uid); ++ pde_data->gid = XT_GID(proc_gid); + + /* statistics */ + pde_stat = create_proc_entry(p->proc_str_stat, proc_perms, +@@ -341,8 +342,8 @@ static int dnetmap_tg_check(const struct + } + pde_stat->data = p; + pde_stat->read_proc = dnetmap_stat_proc_read; +- pde_stat->uid = proc_uid; +- pde_stat->gid = proc_gid; ++ pde_stat->uid = XT_UID(proc_uid); ++ pde_stat->gid = XT_GID(proc_gid); + #endif + + spin_lock_bh(&dnetmap_lock); +--- a/extensions/xt_condition.c ++++ b/extensions/xt_condition.c +@@ -14,6 +14,7 @@ + */ + #include + #include ++#include + #include + #include + #include +@@ -155,8 +156,8 @@ static int condition_mt_check(const stru + var->status_proc->read_proc = condition_proc_read; + var->status_proc->write_proc = condition_proc_write; + list_add(&var->list, &conditions_list); +- var->status_proc->uid = condition_uid_perms; +- var->status_proc->gid = condition_gid_perms; ++ var->status_proc->uid = XT_UID(condition_uid_perms); ++ var->status_proc->gid = XT_GID(condition_gid_perms); + mutex_unlock(&proc_lock); + info->condvar = var; + return 0; +--- a/extensions/compat_xtables.h ++++ b/extensions/compat_xtables.h +@@ -12,6 +12,14 @@ + # warning Kernels below 3.7 not supported. + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0) ++# define XT_UID(x) make_kuid(current_user_ns(), x) ++# define XT_GID(x) make_kgid(current_user_ns(), x) ++#else ++# define XT_UID(x) (x) ++# define XT_GID(x) (x) ++#endif ++ + #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) + # if !defined(CONFIG_NF_CONNTRACK_MARK) + # warning You have CONFIG_NF_CONNTRACK enabled, but CONFIG_NF_CONNTRACK_MARK is not (please enable). +--- a/extensions/xt_quota2.c ++++ b/extensions/xt_quota2.c +@@ -131,8 +131,8 @@ q2_get_counter(const struct xt_quota_mti + p->data = e; + p->read_proc = quota_proc_read; + p->write_proc = quota_proc_write; +- p->uid = quota_list_uid; +- p->gid = quota_list_gid; ++ p->uid = XT_UID(quota_list_uid); ++ p->gid = XT_GID(quota_list_gid); + list_add_tail(&e->list, &counter_list); + spin_unlock_bh(&counter_list_lock); + return e; -- 2.30.2