Modify the pseudo-header checksum functions.
- Remove the initial checksum, which we don't use anywhere.
- Add the upper-layer protocol to the IPv6 function. Currently
this is always the same as the next header field in the IPv6
header, but technically it's the upper-layer header after all
the extension headers. This is required to support fragments.
Bug: 11542311
Change-Id: Ie1a20fa74ee5bc933c1014bab74ae2957979b2b8
diff --git a/ipv6.c b/ipv6.c
index 371d9e1..d188e47 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -125,8 +125,8 @@
out[pos].iov_len = sizeof(struct iphdr);
// Calculate the pseudo-header checksum.
- old_sum = ipv6_pseudo_header_checksum(0, ip6, len_left);
- new_sum = ipv4_pseudo_header_checksum(0, ip_targ, len_left);
+ old_sum = ipv6_pseudo_header_checksum(ip6, len_left, protocol);
+ new_sum = ipv4_pseudo_header_checksum(ip_targ, len_left);
// does not support IPv6 extension headers, this will drop any packet with them
if (protocol == IPPROTO_ICMP) {