[ovs-discuss] [PATCH] datapath: Fix build with backported netdev_alloc_skb_ip_align()

Alexey I. Froloff raorn at altlinux.org
Mon Aug 2 10:20:37 UTC 2010


Signed-off-by: Alexey I. Froloff <raorn at altlinux.org>
---
 acinclude.m4                                       |    2 ++
 .../linux-2.6/compat-2.6/include/linux/skbuff.h    |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 80794da..a0abdb5 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -182,6 +182,8 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
                   [OVS_DEFINE([HAVE_SKBUFF_HEADER_HELPERS])])
   OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [skb_warn_if_lro],
                   [OVS_DEFINE([HAVE_SKB_WARN_LRO])])
+  OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [netdev_alloc_skb_ip_align],
+                  [OVS_DEFINE([HAVE_NETDEV_ALLOC_SKB_IP_ALIGN])])
 
   OVS_GREP_IFELSE([$KSRC26/include/linux/string.h $KSRC26/include/linux/slab.h],
                   [kmemdup], [OVS_DEFINE([HAVE_KMEMDUP])])
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 15acea9..f9358b5 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
@@ -228,7 +228,7 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb)
 #endif /* NETIF_F_LRO */
 #endif /* HAVE_SKB_WARN_LRO */
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
+#ifndef HAVE_NETDEV_ALLOC_SKB_IP_ALIGN
 static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
 							unsigned int length)
 {
@@ -238,7 +238,7 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
 		skb_reserve(skb, NET_IP_ALIGN);
 	return skb;
 }
-#endif /* kernel < 2.6.33 */
+#endif
 
 
 #endif
-- 
1.7.1.1





More information about the discuss mailing list