If there isn't an IPv6 payload, there isn't any TCP or UDP packet, and
there's no TCP or UDP header to checksum, so there's no need for the
check (it's not there for IPv4).
else
ND_PRINT(" (correct)");
}
- } else if (IP_V(ip) == 6 && GET_BE_U_2(ip6->ip6_plen)) {
+ } else if (IP_V(ip) == 6) {
if (ND_TTEST_LEN(tp->th_sport, length)) {
sum = tcp6_cksum(ndo, ip6, tp, length);
tcp_sum = GET_BE_U_2(tp->th_sum);
ND_PRINT("[udp sum ok] ");
}
}
- else if (IP_V(ip) == 6 && GET_BE_U_2(ip6->ip6_plen)) {
+ else if (IP_V(ip) == 6) {
/* for IPv6, UDP checksum is mandatory */
if (ND_TTEST_LEN(cp, length)) {
sum = udp6_cksum(ndo, ip6, up, length + sizeof(struct udphdr));