summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--acinclude.m41
-rw-r--r--datapath/linux-2.6/compat-2.6/include/net/checksum.h4
3 files changed, 5 insertions, 1 deletions
diff --git a/AUTHORS b/AUTHORS
index 38afb2c8e..6abd7ea0a 100644
--- 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
diff --git a/acinclude.m4 b/acinclude.m4
index 565ca6d28..3b691647b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -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])
diff --git a/datapath/linux-2.6/compat-2.6/include/net/checksum.h b/datapath/linux-2.6/compat-2.6/include/net/checksum.h
index e7e7966c2..73f2f5992 100644
--- a/datapath/linux-2.6/compat-2.6/include/net/checksum.h
+++ b/datapath/linux-2.6/compat-2.6/include/net/checksum.h
@@ -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)