summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/include/linux/netfilter/ipset/ip_set_compat.h.in2
-rw-r--r--kernel/net/sched/em_ipset.c16
2 files changed, 18 insertions, 0 deletions
diff --git a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
index d38197c..9809e2a 100644
--- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
+++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
@@ -36,6 +36,8 @@
#@HAVE_USER_NS_IN_STRUCT_NET@ HAVE_USER_NS_IN_STRUCT_NET
#@HAVE_RBTREE_POSTORDER_FOR_EACH_ENTRY_SAFE@ HAVE_RBTREE_POSTORDER_FOR_EACH_ENTRY_SAFE
#@HAVE_KVFREE@ HAVE_KVFREE
+#@HAVE_TCF_EMATCH_OPS_CHANGE_ARG_NET@ HAVE_TCF_EMATCH_OPS_CHANGE_ARG_NET
+#@HAVE_TCF_EMATCH_STRUCT_NET@ HAVE_TCF_EMATCH_STRUCT_NET
/* Not everything could be moved here. Compatibility stuffs can be found in
* xt_set.c, ip_set_core.c, ip_set_getport.c, pfxlen.c too.
diff --git a/kernel/net/sched/em_ipset.c b/kernel/net/sched/em_ipset.c
index 527aeb7..2729d7e 100644
--- a/kernel/net/sched/em_ipset.c
+++ b/kernel/net/sched/em_ipset.c
@@ -15,16 +15,24 @@
#include <linux/string.h>
#include <linux/skbuff.h>
#include <linux/netfilter/xt_set.h>
+#include <linux/netfilter/ipset/ip_set_compat.h>
#include <linux/ipv6.h>
#include <net/ip.h>
#include <net/pkt_cls.h>
+#ifdef HAVE_TCF_EMATCH_OPS_CHANGE_ARG_NET
+static int em_ipset_change(struct net *net, void *data, int data_len,
+ struct tcf_ematch *em)
+#else
static int em_ipset_change(struct tcf_proto *tp, void *data, int data_len,
struct tcf_ematch *em)
+#endif
{
struct xt_set_info *set = data;
ip_set_id_t index;
+#ifndef HAVE_TCF_EMATCH_OPS_CHANGE_ARG_NET
struct net *net = dev_net(qdisc_dev(tp->q));
+#endif
if (data_len != sizeof(*set))
return -EINVAL;
@@ -42,11 +50,19 @@ static int em_ipset_change(struct tcf_proto *tp, void *data, int data_len,
return -ENOMEM;
}
+#ifdef HAVE_TCF_EMATCH_STRUCT_NET
+static void em_ipset_destroy(struct tcf_ematch *em)
+#else
static void em_ipset_destroy(struct tcf_proto *p, struct tcf_ematch *em)
+#endif
{
const struct xt_set_info *set = (const void *) em->data;
if (set) {
+#ifdef HAVE_TCF_EMATCH_STRUCT_NET
+ ip_set_nfnl_put(em->net, set->index);
+#else
ip_set_nfnl_put(dev_net(qdisc_dev(p->q)), set->index);
+#endif
kfree((void *) em->data);
}
}