Linux 2.6.22 introduced functions skb_copy_from_linear_data_offset()
and skb_copy_to_linear_data_offset(). In earlier versions we defined them.
But Xen backports these functions, so this became a duplicate definition.
So check for them at configure time instead of depending on the kernel
version number.
[OFP_DEFINE([HAVE_SKBUFF_HEADER_HELPERS])])
OFP_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [raw],
[OFP_DEFINE([HAVE_MAC_RAW])])
+ OFP_GREP_IFELSE([$KSRC26/include/linux/skbuff.h],
+ [skb_copy_from_linear_data_offset],
+ [OFP_DEFINE([HAVE_SKB_COPY_FROM_LINEAR_DATA_OFFSET])])
OFP_GREP_IFELSE([$KSRC26/include/net/netlink.h], [NLA_NUL_STRING],
[OFP_DEFINE([HAVE_NLA_NUL_STRING])])
OFP_CHECK_VETH
#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
+#ifndef HAVE_SKB_COPY_FROM_LINEAR_DATA_OFFSET
static inline void skb_copy_from_linear_data_offset(const struct sk_buff *skb,
const int offset, void *to,
const unsigned int len)
memcpy(skb->data + offset, from, len);
}
-#endif /* linux < 2.6.22 */
+#endif /* !HAVE_SKB_COPY_FROM_LINEAR_DATA_OFFSET */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)