]> 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]>
Mon, 20 Oct 2014 18:34:24 +0000 (11:34 -0700)
print-udp.c

index 134a98ccb0e7cddf809ff3ea9ba2b52474939b42..eafdaf88748c0932196e19deb0d005c930d1b135 100644 (file)
@@ -684,8 +684,7 @@ udp_print(netdissect_options *ndo, register const u_char *bp, u_int length,
                                ND_PRINT((ndo, "UDP, bad length %u > %u",
                                    ulen, length));
                        else
-                               ND_PRINT((ndo, "UDP, length %u",
-                                   (uint32_t)(ulen - sizeof(*up))));
+                               ND_PRINT((ndo, "UDP, length %u", ulen));
                }
 #undef ISPORT
        } else {
@@ -693,8 +692,7 @@ udp_print(netdissect_options *ndo, register const u_char *bp, u_int length,
                        ND_PRINT((ndo, "UDP, bad length %u > %u",
                            ulen, length));
                else
-                       ND_PRINT((ndo, "UDP, length %u",
-                           (uint32_t)(ulen - sizeof(*up))));
+                       ND_PRINT((ndo, "UDP, length %u", ulen));
        }
 }