From: Jesse Gross Date: Tue, 7 Dec 2010 03:02:14 +0000 (-0800) Subject: datapath: Compatibility code for inet_proto_csum_replace2. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2986c21ea17a4f31ce153dea12d1f39d05ae5996;p=openvswitch datapath: Compatibility code for inet_proto_csum_replace2. Kernels earlier than 2.6.25 did not define inet_proto_csum_replace2, so implement it ourselves. Signed-off-by: Jesse Gross --- 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 a8c47d85..c2ffb341 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 @@ -25,6 +25,10 @@ static inline void csum_replace4(__sum16 *sum, __be32 from, __be32 to) sum = csum_fold(csum_partial((char *)diff, sizeof(diff), ~csum_unfold(*sum))); } + +#define inet_proto_csum_replace2(sum, skb, from, to, pseudohdr) \ + inet_proto_csum_replace4(sum, skb, (__force __be32)(from), \ + (__force __be32)(to), pseudohdr) #endif #endif /* checksum.h */