summaryrefslogtreecommitdiffstats
path: root/checksum.h
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2013-04-08 18:02:24 +0900
committerLorenzo Colitti <lorenzo@google.com>2013-04-09 17:14:40 +0900
commit0278627f576832860af2d84e04e383ecaa92d74f (patch)
tree32e195850b333b077be9f7e998d445feeb4b39ec /checksum.h
parent41e758e33e6c3b43f363591d4113dea54a4330d9 (diff)
downloadandroid_external_android-clat-0278627f576832860af2d84e04e383ecaa92d74f.tar.gz
android_external_android-clat-0278627f576832860af2d84e04e383ecaa92d74f.tar.bz2
android_external_android-clat-0278627f576832860af2d84e04e383ecaa92d74f.zip
Pass in the length to pseudo checksum functions
Currently, the pseudo-header checksum calculation functions get the transport layer length from the IP header. This requires that the length be known at IP header construction time, which does not allow transport layer translation functions to change the length of the packet later. Have the transport functions pass in the size directly. Bug: 8276725 Change-Id: I76a93f5e66181bec21d68f779c68c54090a77c33
Diffstat (limited to 'checksum.h')
-rw-r--r--checksum.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/checksum.h b/checksum.h
index c8346a0..473f5f5 100644
--- a/checksum.h
+++ b/checksum.h
@@ -18,11 +18,11 @@
#ifndef __CHECKSUM_H__
#define __CHECKSUM_H__
-uint32_t ip_checksum_add(uint32_t current_sum, const void *data, int len);
+uint32_t ip_checksum_add(uint32_t current, const void *data, int len);
uint16_t ip_checksum_finish(uint32_t temp_sum);
uint16_t ip_checksum(const void *data, int len);
-uint32_t ipv6_pseudo_header_checksum(uint32_t current_sum, const struct ip6_hdr *ip6);
-uint32_t ipv4_pseudo_header_checksum(uint32_t current_sum, const struct iphdr *ip);
+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);
#endif /* __CHECKSUM_H__ */