From: Ben Pfaff Date: Fri, 14 May 2010 22:44:39 +0000 (-0700) Subject: datapath: Fix build with backported skb_dst(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85444c3f79f594c838d4b3e72ff27e263514f194;p=openvswitch datapath: Fix build with backported skb_dst(). 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. --- diff --git a/acinclude.m4 b/acinclude.m4 index 70498a99..8643cf7b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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])]) 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 e8dc72ec..5ed0e48f 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 @@ -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;