diff options
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r-- | include/net/ip_vs.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 903108e583f8..672564e5a81d 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -988,14 +988,20 @@ extern int ip_vs_make_skb_writable(struct sk_buff **pskb, int len); | |||
988 | extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp, | 988 | extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp, |
989 | struct ip_vs_conn *cp, int dir); | 989 | struct ip_vs_conn *cp, int dir); |
990 | 990 | ||
991 | extern u16 ip_vs_checksum_complete(struct sk_buff *skb, int offset); | 991 | extern __sum16 ip_vs_checksum_complete(struct sk_buff *skb, int offset); |
992 | 992 | ||
993 | static inline u16 ip_vs_check_diff(u32 old, u32 new, u16 oldsum) | 993 | static inline __wsum ip_vs_check_diff4(__be32 old, __be32 new, __wsum oldsum) |
994 | { | 994 | { |
995 | u32 diff[2] = { old, new }; | 995 | __be32 diff[2] = { ~old, new }; |
996 | 996 | ||
997 | return csum_fold(csum_partial((char *) diff, sizeof(diff), | 997 | return csum_partial((char *) diff, sizeof(diff), oldsum); |
998 | oldsum ^ 0xFFFF)); | 998 | } |
999 | |||
1000 | static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum) | ||
1001 | { | ||
1002 | __be16 diff[2] = { ~old, new }; | ||
1003 | |||
1004 | return csum_partial((char *) diff, sizeof(diff), oldsum); | ||
999 | } | 1005 | } |
1000 | 1006 | ||
1001 | #endif /* __KERNEL__ */ | 1007 | #endif /* __KERNEL__ */ |