]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Remove the IPv6 payload length checks for checksumming.
authorGuy Harris <[email protected]>
Wed, 1 May 2019 07:23:08 +0000 (00:23 -0700)
committerGuy Harris <[email protected]>
Wed, 1 May 2019 07:23:08 +0000 (00:23 -0700)
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).

print-tcp.c
print-udp.c

index f3b635b4deca7270a7dd515d1db932675d2dbe09..4f95e334ff8cfb480f6dc3b7617cce6132556b12 100644 (file)
@@ -399,7 +399,7 @@ tcp_print(netdissect_options *ndo,
                                 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);
index ed517580e356734ddeafa70989f26dd160e9f21f..bf5c7ba52ff4c11794261bf358f97e4c1e7a1a74 100644 (file)
@@ -571,7 +571,7 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length,
                                        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));