]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Don't subtract the UDP header size from the length twice.
authorGuy Harris <[email protected]>
Mon, 20 Oct 2014 18:34:24 +0000 (11:34 -0700)
committerGuy Harris <[email protected]>
Wed, 19 Nov 2014 08:46:23 +0000 (00:46 -0800)
print-udp.c

index 319e8e8a9b10cf7418791ceac2323bbfa8cee92b..f0b5bb6c52a7df01a5f7fd9cc756176686fb5ec5 100644 (file)
@@ -666,8 +666,7 @@ udp_print(register const u_char *bp, u_int length,
                                printf("UDP, bad length %u > %u",
                                    ulen, length);
                        else
-                               printf("UDP, length %u",
-                                   (uint32_t)(ulen - sizeof(*up)));
+                               printf("UDP, length %u", ulen);
                }
 #undef ISPORT
        } else {
@@ -675,8 +674,7 @@ udp_print(register const u_char *bp, u_int length,
                        printf("UDP, bad length %u > %u",
                            ulen, length);
                else
-                       printf("UDP, length %u",
-                           (uint32_t)(ulen - sizeof(*up)));
+                       printf("UDP, length %u", ulen);
        }
 }