aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/checksum.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/checksum.h')
-rw-r--r--include/net/checksum.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/checksum.h b/include/net/checksum.h
index aef2b2bb6603..051307cc877f 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -143,6 +143,11 @@ static inline void csum_replace2(__sum16 *sum, __be16 old, __be16 new)
*sum = ~csum16_add(csum16_sub(~(*sum), old), new);
}
+static inline void csum_replace(__wsum *csum, __wsum old, __wsum new)
+{
+ *csum = csum_add(csum_sub(*csum, old), new);
+}
+
struct sk_buff;
void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb,
__be32 from, __be32 to, bool pseudohdr);