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 70498a995fb9efe8722d52533f24dca599ad24e5..8643cf7b6d3375f2d052d4c87ba2dd5ad68fd454 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 e8dc72ecd557ca35f51a01d65a84d4818a5972bb..5ed0e48ff3c73fc8f60447e2023748da776c96fd 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;