datapath: Fix compilation on kernel 2.6.32
authorPravin B Shelar <pshelar@nicira.com>
Fri, 9 Oct 2015 20:21:30 +0000 (13:21 -0700)
committerPravin B Shelar <pshelar@nicira.com>
Fri, 9 Oct 2015 21:23:21 +0000 (14:23 -0700)
Fixes following compilation error:

CC [M]  /home/travis/build/openvswitch/ovs/datapath/linux/actions.o

In file included from
/home/travis/build/openvswitch/ovs/datapath/linux/actions.c:21:0:

/home/travis/build/openvswitch/ovs/datapath/linux/compat/include/linux/skbuff.h:
In function ‘rpl_skb_postpull_rcsum’:

/home/travis/build/openvswitch/ovs/datapath/linux/compat/include/linux/skbuff.h:384:4:
error: implicit declaration of function ‘skb_checksum_start_offset’
[-Werror=implicit-function-declaration]

cc1: some warnings being treated as errors

Reported-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
acinclude.m4
datapath/linux/compat/include/linux/skbuff.h

index 42d1f45..e4846d9 100644 (file)
@@ -363,6 +363,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   # quoting rules.
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [[[^@]]proto_data_valid],
                   [OVS_DEFINE([HAVE_PROTO_DATA_VALID])])
+  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_checksum_start_offset])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [kfree_skb_list])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [rxhash])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [u16.*rxhash],
index 23b13b8..4d81bc8 100644 (file)
@@ -373,6 +373,13 @@ void rpl_kfree_skb_list(struct sk_buff *segs);
 #define kfree_skb_list rpl_kfree_skb_list
 #endif
 
+#ifndef HAVE_SKB_CHECKSUM_START_OFFSET
+static inline int skb_checksum_start_offset(const struct sk_buff *skb)
+{
+       return skb->csum_start - skb_headroom(skb);
+}
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
 #define skb_postpull_rcsum rpl_skb_postpull_rcsum
 static inline void skb_postpull_rcsum(struct sk_buff *skb,