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

index a5d4370e7113fe9e19fd02c2ae02808daec36164..8f07ef7de4665cbe11fddacaf9e22fe2093aaf4a 100644 (file)
@@ -709,8 +709,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 {
@@ -718,8 +717,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);
        }
 }