datapath: Fix build with backported skb_dst().
authorBen Pfaff <blp@nicira.com>
Fri, 14 May 2010 22:44:39 +0000 (15:44 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 17 May 2010 16:35:31 +0000 (09:35 -0700)
An upcoming backport adds skb_dst() to a pre-2.6.31 Linux kernel, so we
have to check for the presence of an skb_dst() definition instead of for
the particular kernel version.

acinclude.m4
datapath/linux-2.6/compat-2.6/include/linux/skbuff.h

index 70498a9..8643cf7 100644 (file)
@@ -160,6 +160,8 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
                   [OVS_DEFINE([HAVE_PROTO_DATA_VALID])])
   OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [raw],
                   [OVS_DEFINE([HAVE_MAC_RAW])])
+  OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [skb_dst(],
+                  [OVS_DEFINE([HAVE_SKB_DST_ACCESSOR_FUNCS])])
   OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], 
                   [skb_copy_from_linear_data_offset],
                   [OVS_DEFINE([HAVE_SKB_COPY_FROM_LINEAR_DATA_OFFSET])])
index e8dc72e..5ed0e48 100644 (file)
@@ -83,7 +83,7 @@ static inline int skb_clone_writable(struct sk_buff *skb, int len)
 }
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+#ifndef HAVE_SKB_DST_ACCESSOR_FUNCS
 static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
 {
        return (struct dst_entry *)skb->dst;