[OVS_DEFINE([HAVE_NLA_GET_BE16])])
OVS_GREP_IFELSE([$KSRC26/include/linux/in.h], [ipv4_is_multicast],
[OVS_DEFINE([HAVE_IPV4_IS_MULTICAST])])
+ OVS_GREP_IFELSE([$KSRC26/include/linux/string.h $KSRC26/include/linux/slab.h],
+ [kmemdup], [OVS_DEFINE([HAVE_KMEMDUP])])
# Check for the proto_data_valid member in struct sk_buff. The [^@]
# is necessary because some versions of this header remove the
# member but retain the kerneldoc comment that describes it (which
linux-2.6/compat-2.6/dev-openvswitch.c \
linux-2.6/compat-2.6/genetlink-openvswitch.c \
linux-2.6/compat-2.6/ip_output-openvswitch.c \
+ linux-2.6/compat-2.6/kmemdup.c \
linux-2.6/compat-2.6/random32.c \
linux-2.6/compat-2.6/skbuff-openvswitch.c
openvswitch_headers += \
linux-2.6/compat-2.6/include/linux/rculist.h \
linux-2.6/compat-2.6/include/linux/rtnetlink.h \
linux-2.6/compat-2.6/include/linux/skbuff.h \
+ linux-2.6/compat-2.6/include/linux/slab.h \
linux-2.6/compat-2.6/include/linux/tcp.h \
linux-2.6/compat-2.6/include/linux/timer.h \
linux-2.6/compat-2.6/include/linux/types.h \
--- /dev/null
+#ifndef __LINUX_SLAB_WRAPPER_H
+#define __LINUX_SLAB_WRAPPER_H 1
+
+#include_next <linux/slab.h>
+
+#ifndef HAVE_KMEMDUP
+extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
+#endif
+
+#endif
--- /dev/null
+#ifndef HAVE_KMEMDUP
+
+#include <linux/slab.h>
+#include <linux/string.h>
+
+/**
+ * kmemdup - duplicate region of memory
+ *
+ * @src: memory region to duplicate
+ * @len: memory region length
+ * @gfp: GFP mask to use
+ */
+void *kmemdup(const void *src, size_t len, gfp_t gfp)
+{
+ void *p;
+
+ p = kmalloc(len, gfp);
+ if (p)
+ memcpy(p, src, len);
+ return p;
+}
+#endif