[ovs-dev] [PATCH] datapath: Fix compilation on kernel 2.6.32

Pravin B Shelar pshelar at nicira.com
Fri Oct 9 20:21:30 UTC 2015


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 at nicira.com>
Signed-off-by: Pravin B Shelar <pshelar at nicira.com>
---
 acinclude.m4                                 |    1 +
 datapath/linux/compat/include/linux/skbuff.h |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 42d1f45..e4846d9 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -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],
diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h
index 23b13b8..331a523 100644
--- a/datapath/linux/compat/include/linux/skbuff.h
+++ b/datapath/linux/compat/include/linux/skbuff.h
@@ -380,9 +380,11 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb,
 {
 	if (skb->ip_summed == CHECKSUM_COMPLETE)
 		skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
+#ifdef HAVE_SKB_CHECKSUM_START_OFFSET
 	else if (skb->ip_summed == CHECKSUM_PARTIAL &&
 			skb_checksum_start_offset(skb) <= len)
 		skb->ip_summed = CHECKSUM_NONE;
+#endif
 }
 
 #define skb_pull_rcsum rpl_skb_pull_rcsum
-- 
1.7.1




More information about the dev mailing list