summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac10
-rw-r--r--kernel/include/linux/netfilter/ipset/ip_set_compat.h.in5
2 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 73a2f8c..2df76b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -383,6 +383,16 @@ else
AC_SUBST(HAVE_RBTREE_POSTORDER_FOR_EACH_ENTRY_SAFE, undef)
fi
+AC_MSG_CHECKING([kernel source for kvcalloc])
+if test -f $ksourcedir/include/linux/mm.h && \
+ $GREP -q 'kvcalloc' $ksourcedir/include/linux/mm.h; then
+ AC_MSG_RESULT(yes)
+ AC_SUBST(HAVE_KVCALLOC, define)
+else
+ AC_MSG_RESULT(no)
+ AC_SUBST(HAVE_KVCALLOC, undef)
+fi
+
AC_MSG_CHECKING([kernel source for kvfree])
if test -f $ksourcedir/include/linux/mm.h && \
$GREP -q 'kvfree' $ksourcedir/include/linux/mm.h; then
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 72b77b3..53bd588 100644
--- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
+++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
@@ -23,6 +23,7 @@
#@HAVE_NET_OPS_ID@ HAVE_NET_OPS_ID
#@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_KVCALLOC@ HAVE_KVCALLOC
#@HAVE_KVFREE@ HAVE_KVFREE
#@HAVE_XT_MTCHK_PARAM_STRUCT_NET@ HAVE_XT_MTCHK_PARAM_STRUCT_NET
#@HAVE_TCF_EMATCH_OPS_CHANGE_ARG_NET@ HAVE_TCF_EMATCH_OPS_CHANGE_ARG_NET
@@ -215,6 +216,10 @@ static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value)
ipv6_skip_exthdr(skbuff, start, nexthdrp)
#endif
+#ifndef HAVE_KVCALLOC
+#define kvcalloc(n, size, flags) kcalloc(n, size, flags)
+#endif
+
#ifndef HAVE_KVFREE
#include <linux/vmalloc.h>
static inline void kvfree(const void *addr)