DO NOT MERGE: Fix up checksums instead of recalculating them.
Currently the checksums of translated packets are calculated
from scratch by checksumming the translated packet. This is slow
and does not work in the case of fragments, because the whole
packet is not available. Instead, calculate the checksum by
adjusting the checksum of the original packet.
Bug: 11542311
Bug: 12116252
Change-Id: I457347753d1bb5b23e3ae759bf2e4388102772d7
diff --git a/checksum.h b/checksum.h
index 473f5f5..44921f0 100644
--- a/checksum.h
+++ b/checksum.h
@@ -25,4 +25,6 @@
uint32_t ipv6_pseudo_header_checksum(uint32_t current, const struct ip6_hdr *ip6, uint16_t len);
uint32_t ipv4_pseudo_header_checksum(uint32_t current, const struct iphdr *ip, uint16_t len);
+uint16_t ip_checksum_adjust(uint16_t checksum, uint32_t old_hdr_sum, uint32_t new_hdr_sum);
+
#endif /* __CHECKSUM_H__ */