]> 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:28:05 +0000 (00:28 -0800)
print-udp.c

index cded2aefe706c9c70c3e514ab99dccec591d251e..ed7c5541ac807460064f744c9b34944022276fb0 100644 (file)
@@ -684,8 +684,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 {
@@ -693,8 +692,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);
        }
 }