aboutsummaryrefslogtreecommitdiff
path: root/include/net/ip_vs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r--include/net/ip_vs.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 49c717e3b04..672564e5a81 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -7,6 +7,7 @@
#define _IP_VS_H
#include <asm/types.h> /* For __uXX types */
+#include <linux/types.h> /* For __beXX types in userland */
#define IP_VS_VERSION_CODE 0x010201
#define NVERSION(version) \
@@ -987,14 +988,20 @@ extern int ip_vs_make_skb_writable(struct sk_buff **pskb, int len);
extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp,
struct ip_vs_conn *cp, int dir);
-extern u16 ip_vs_checksum_complete(struct sk_buff *skb, int offset);
+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__ */