datapath: Avoid backported csum_replace4() on RHEL 5.
authorJesse Gross <jesse@nicira.com>
Wed, 19 Jan 2011 17:29:06 +0000 (09:29 -0800)
committerJesse Gross <jesse@nicira.com>
Wed, 19 Jan 2011 17:49:30 +0000 (09:49 -0800)
Reported-by: Koichi Yagishita <yagishita.koichi@jrc.co.jp>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
AUTHORS
acinclude.m4
datapath/linux-2.6/compat-2.6/include/net/checksum.h

diff --git a/AUTHORS b/AUTHORS
index 38afb2c8e54516f557ea798676836744f22372f0..6abd7ea0a749636fdc0a8e6baced0f2ae156b8ea 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -56,6 +56,7 @@ Jan Medved              jmedved@juniper.net
 Jeongkeun Lee           jklee@hp.com
 Joan Cirer              joan@ev0.net
 John Galgay             john@galgay.net
+Koichi Yagishita        yagishita.koichi@jrc.co.jp
 Krishna Miriyala        krishna@nicira.com
 Luiz Henrique Ozaki     luiz.ozaki@gmail.com
 Michael Mao             mmao@nicira.com
index 565ca6d28226b20101a560dad275910f68110d21..3b691647b5cecef069ed213a042e177781cc0bc8 100644 (file)
@@ -195,6 +195,7 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
   OVS_GREP_IFELSE([$KSRC26/include/linux/types.h], [__wsum],
                   [OVS_DEFINE([HAVE_CSUM_TYPES])])
 
+  OVS_GREP_IFELSE([$KSRC26/include/net/checksum.h], [csum_replace4])
   OVS_GREP_IFELSE([$KSRC26/include/net/checksum.h], [csum_unfold])
 
   OVS_GREP_IFELSE([$KSRC26/include/net/netlink.h], [NLA_NUL_STRING])
index e7e7966c2dca8f2a528b20d740b3cdfedf9800ce..73f2f5992dbeb93713a8098324e1ff48f937eda8 100644 (file)
@@ -18,14 +18,16 @@ static inline __wsum csum_unfold(__sum16 n)
        csum_and_copy_to_user(src, dst, len, sum, NULL, err_ptr)
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
+#ifndef HAVE_CSUM_REPLACE4
 static inline void csum_replace4(__sum16 *sum, __be32 from, __be32 to)
 {
        __be32 diff[] = { ~from, to };
 
        *sum = csum_fold(csum_partial((char *)diff, sizeof(diff), ~csum_unfold(*sum)));
 }
+#endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
 #define inet_proto_csum_replace2(sum, skb, from, to, pseudohdr) \
        inet_proto_csum_replace4(sum, skb, (__force __be32)(from), \
                                           (__force __be32)(to), pseudohdr)