From e215ebca67720188724344eb198c5045c02e375f Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Wed, 8 Sep 2010 10:04:47 -0700 Subject: [PATCH] datapath: Check for backported __wsum and __sum16. Reported-by: Alexey I. Froloff Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- acinclude.m4 | 2 ++ datapath/linux-2.6/compat-2.6/include/linux/kernel.h | 1 + datapath/linux-2.6/compat-2.6/include/linux/types.h | 7 ++----- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 80794dac3..f1322fa0e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -188,6 +188,8 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [ OVS_GREP_IFELSE([$KSRC26/include/linux/types.h], [bool], [OVS_DEFINE([HAVE_BOOL_TYPE])]) + OVS_GREP_IFELSE([$KSRC26/include/linux/types.h], [__wsum], + [OVS_DEFINE([HAVE_CSUM_TYPES])]) OVS_GREP_IFELSE([$KSRC26/include/net/checksum.h], [csum_unfold], [OVS_DEFINE([HAVE_CSUM_UNFOLD])]) diff --git a/datapath/linux-2.6/compat-2.6/include/linux/kernel.h b/datapath/linux-2.6/compat-2.6/include/linux/kernel.h index 1f65c099a..13361f78d 100644 --- a/datapath/linux-2.6/compat-2.6/include/linux/kernel.h +++ b/datapath/linux-2.6/compat-2.6/include/linux/kernel.h @@ -6,6 +6,7 @@ #include #endif +#include #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) #undef pr_emerg #define pr_emerg(fmt, ...) \ diff --git a/datapath/linux-2.6/compat-2.6/include/linux/types.h b/datapath/linux-2.6/compat-2.6/include/linux/types.h index d88baf71c..b989d96c3 100644 --- a/datapath/linux-2.6/compat-2.6/include/linux/types.h +++ b/datapath/linux-2.6/compat-2.6/include/linux/types.h @@ -3,13 +3,10 @@ #include_next -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) - +#ifndef HAVE_CSUM_TYPES typedef __u16 __bitwise __sum16; typedef __u32 __bitwise __wsum; - -#endif /* linux kernel < 2.6.20 */ +#endif #ifndef HAVE_BOOL_TYPE typedef _Bool bool; -- 2.43.0