AC_SUBST(HAVE_KVFREE, undef)
fi
+AC_MSG_CHECKING([kernel source for struct net in the change function of tcf_ematch_ops])
+if test -f $ksourcedir/include/net/pkt_cls.h && \
+ $AWK '/^struct tcf_ematch_ops / {for(i=1; i<=5; i++) {getline; print}}' $ksourcedir/include/net/pkt_cls.h | \
+ $GREP -q '\*change..struct net \*net'; then
+ AC_MSG_RESULT(yes)
+ AC_SUBST(HAVE_TCF_EMATCH_OPS_CHANGE_ARG_NET, define)
+else
+ AC_MSG_RESULT(no)
+ AC_SUBST(HAVE_TCF_EMATCH_OPS_CHANGE_ARG_NET, undef)
+fi
+
+AC_MSG_CHECKING([kernel source for struct net in struct tcf_ematch])
+if test -f $ksourcedir/include/net/pkt_cls.h && \
+ $AWK '/^struct tcf_ematch_ops / {for(i=1; i<=7; i++) {getline; print}}' $ksourcedir/include/net/pkt_cls.h | \
+ $GREP -q 'struct net'; then
+ AC_MSG_RESULT(yes)
+ AC_SUBST(HAVE_TCF_EMATCH_STRUCT_NET, define)
+else
+ AC_MSG_RESULT(no)
+ AC_SUBST(HAVE_TCF_EMATCH_STRUCT_NET, undef)
+fi
+
AC_MSG_CHECKING([kernel source for struct net_generic])
if test -f $ksourcedir/include/net/netns/generic.h && \
$GREP -q 'struct net_generic' $ksourcedir/include/net/netns/generic.h; then
#@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.
#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;
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);
}
}