]> The Tcpdump Group git mirrors - tcpdump/commitdiff
QUIC: Fix getting packet type in Long Header
authorFrancois-Xavier Le Bail <[email protected]>
Tue, 9 Nov 2021 19:13:01 +0000 (20:13 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 9 Nov 2021 19:25:15 +0000 (20:25 +0100)
This change should fix the Coverity Scan issue CID 1493488:
178                             ND_PRINT(", handshake");
>>> CID 1493488:  Control flow issues  (DEADCODE)
>>> Execution cannot reach this statement: "if (packet_type == QUIC_LH_...".
179                     else if (packet_type == QUIC_LH_TYPE_RETRY)

print-quic.c

index d6963b77ef039ad1508335c49f801326cb4bfd3d..be1a5450ea62425528b2813af3c3dd1701975fb2 100644 (file)
@@ -164,7 +164,7 @@ quic_print_packet(netdissect_options *ndo, const u_char *bp, const u_char *end)
        bp += 1;
        if (first_octet & 0x80) {
                /* Long Header */
-               packet_type = (first_octet >> 4) & 0x02;
+               packet_type = (first_octet >> 4) & 0x03;
                version = GET_BE_U_4(bp);
                bp += 4;