summaryrefslogtreecommitdiffstats
path: root/include/net/ip_vs.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-16 02:41:18 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:23:41 -0800
commitf9214b2627fb8582af1986afc4aed5942086a535 (patch)
tree13bd40def90b1bcf77e2c79a4fcabf60a4d5d444 /include/net/ip_vs.h
parent5c78f275e696a25a9919671aa8aa3d0a3d967978 (diff)
downloadop-kernel-dev-f9214b2627fb8582af1986afc4aed5942086a535.zip
op-kernel-dev-f9214b2627fb8582af1986afc4aed5942086a535.tar.gz
[NET]: ipvs checksum annotations.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r--include/net/ip_vs.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index fedea8d..672564e 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -990,12 +990,18 @@ extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp,
extern __sum16 ip_vs_checksum_complete(struct sk_buff *skb, int offset);
-static inline u16 ip_vs_check_diff(u32 old, u32 new, u16 oldsum)
+static inline __wsum ip_vs_check_diff4(__be32 old, __be32 new, __wsum oldsum)
{
- u32 diff[2] = { old, new };
+ __be32 diff[2] = { ~old, new };
- return csum_fold(csum_partial((char *) diff, sizeof(diff),
- oldsum ^ 0xFFFF));
+ return csum_partial((char *) diff, sizeof(diff), oldsum);
+}
+
+static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum)
+{
+ __be16 diff[2] = { ~old, new };
+
+ return csum_partial((char *) diff, sizeof(diff), oldsum);
}
#endif /* __KERNEL__ */
OpenPOWER on IntegriCloud