From: Ben Pfaff Date: Tue, 3 Feb 2009 18:27:22 +0000 (-0800) Subject: Don't define skb_copy_{to,from}_linear_data_offset if it is available. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98dabbc2852dcf5dbd3900f4fd8ed150f22afc14;p=openvswitch Don't define skb_copy_{to,from}_linear_data_offset if it is available. 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. --- diff --git a/acinclude.m4 b/acinclude.m4 index d4795fd5..c9c9f7a1 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -120,6 +120,9 @@ AC_DEFUN([OFP_CHECK_LINUX26_COMPAT], [ [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 diff --git a/datapath/linux-2.6/compat-2.6/include/linux/skbuff.h b/datapath/linux-2.6/compat-2.6/include/linux/skbuff.h index 9d38c46d..55d32eb1 100644 --- a/datapath/linux-2.6/compat-2.6/include/linux/skbuff.h +++ b/datapath/linux-2.6/compat-2.6/include/linux/skbuff.h @@ -5,7 +5,7 @@ #include -#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) @@ -21,7 +21,7 @@ static inline void skb_copy_to_linear_data_offset(struct sk_buff *skb, 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)