xtables-addons: update to version 2.3, adds linux 3.10 compatibility
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 37226
This commit is contained in:
parent
e3a28f415b
commit
4a0c312dc3
7 changed files with 12 additions and 95 deletions
|
@ -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.1
|
||||
PKG_VERSION:=2.3
|
||||
PKG_RELEASE:=1
|
||||
PKG_MD5SUM:=b624fc57bbda9e15c33a6471e4ec75e1
|
||||
PKG_MD5SUM:=7d942729c365a549513511061f74c3e3
|
||||
else
|
||||
PKG_VERSION:=1.45
|
||||
PKG_RELEASE:=3
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
-install-exec-hook:
|
||||
- depmod -a || :;
|
||||
-
|
||||
config.status: Makefile.iptrules.in
|
||||
clean-local-mans:
|
||||
${MAKE} -f Makefile.mans clean;
|
||||
|
||||
tmpdir := $(shell mktemp -dtu)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -11892,7 +11892,7 @@ regular_CFLAGS="-Wall -Waggregate-return
|
||||
@@ -11895,7 +11895,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; }
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
--- a/extensions/compat_xtables.h
|
||||
+++ b/extensions/compat_xtables.h
|
||||
@@ -57,4 +57,11 @@
|
||||
|
||||
#define xt_request_find_match xtnu_request_find_match
|
||||
@@ -82,4 +82,11 @@ static inline void proc_remove(struct pr
|
||||
}
|
||||
#endif
|
||||
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
|
||||
+static inline void proc_net_remove(struct net *net, const char *name)
|
||||
|
|
|
@ -1,83 +0,0 @@
|
|||
--- 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) KUIDT_INIT(x)
|
||||
+# define XT_GID(x) KGIDT_INIT(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;
|
Loading…
Reference in a new issue