xtables-addons: update to v2.1, fix compilation against Linux 3.7.2, refresh patches
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 17 Jan 2013 11:20:51 +0000 (11:20 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 17 Jan 2013 11:20:51 +0000 (11:20 +0000)
SVN-Revision: 35192

net/xtables-addons/Makefile
net/xtables-addons/patches/002-fix-kernel-version-detection.patch
net/xtables-addons/patches/100-add-rtsp-conntrack.patch
net/xtables-addons/patches/102-rtsp-linux-3.7-compat.patch
net/xtables-addons/patches/110-dnetmap-linux-3.7.patch [deleted file]
net/xtables-addons/patches/200-add-lua-packetscript.patch
net/xtables-addons/patches/400-uid-gid-linux-3.7-compat.patch [new file with mode: 0644]

index 9bf39dab444dc6fb4acd987a5f92e38634e5f80b..2bac214ebdb230cefc4ca1c6a565ad003fb7d261 100644 (file)
@@ -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
index b31f9f16c53d61281ef9a808a9a1a3e2144b3c9e..8dc63844787b50b4580ca9d5e1afbb5986a2d710 100644 (file)
@@ -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; }
index 34cdc8c17cc959d3b15dd26600a0f027317ed722..9e105b43acbb2a358ff2c40e990395d7462ae39a 100644 (file)
 +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
  -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
index 7fc37f7890e7cfa3b36b4c81559c984011f2eab8..0fe7917cff506ffc01180e2f876b9ec00209e8cc 100644 (file)
@@ -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 <linux/module.h>
  #include <net/tcp.h>
@@ -61,7 +61,7 @@
  
  #include <linux/inet.h>
  #include <linux/ctype.h>
-@@ -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");
              {
                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
       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:
          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)
  {
      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 (file)
index f0aa6d4..0000000
+++ /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 <linux/netfilter_ipv4.h>
- #include <linux/netfilter/x_tables.h>
- #include <linux/version.h>
--#include <net/netfilter/nf_nat_rule.h>
-+#include <net/netfilter/nf_nat.h>
- #include <net/net_namespace.h>
- #include <net/netns/generic.h>
- #include <linux/netfilter/nf_nat.h>
---- 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
index 1717bf527c7ebef49bd58e5010c97f2c38762287..c2731b74a33d187267392ac659b41c442ecc4bd4 100644 (file)
 +
 --- 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/
  -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 (file)
index 0000000..1d9991a
--- /dev/null
@@ -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 <linux/inet.h>
+ #include <linux/ip.h>
++#include <linux/version.h>
+ #include <linux/module.h>
+ #include <linux/netdevice.h>
+ #include <linux/netfilter.h>
+@@ -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 <linux/kernel.h>
+ #include <linux/list.h>
++#include <linux/version.h>
+ #include <linux/module.h>
+ #include <linux/proc_fs.h>
+ #include <linux/spinlock.h>
+@@ -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;