]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Properly test ZERO_TTLV flag in otlv_print().
authorGuy Harris <[email protected]>
Thu, 8 Jan 2015 01:11:55 +0000 (17:11 -0800)
committerGuy Harris <[email protected]>
Thu, 8 Jan 2015 21:22:29 +0000 (13:22 -0800)
If that flag is set, the TLV in question is empty, so don't process
anything further - and if it's *not* empty, report an error.

Thanks to Maks Naumov for finding this.

print-forces.c

index 34ac7a08b8992919286faa56646980e7c9fb4511..dc3585b09c27ab131ecb70ab917176f5d7df65ea 100644 (file)
@@ -1188,7 +1188,7 @@ otlv_print(netdissect_options *ndo,
                       EXTRACT_16BITS(&otlv->length)));
        }
        /* empty TLVs like COMMIT and TRCOMMIT are empty, we stop here .. */
-       if (!ops->flags & ZERO_TTLV) {
+       if (ops->flags & ZERO_TTLV) {
                if (tll != 0)   /* instead of "if (tll)" - for readability .. */
                        ND_PRINT((ndo, "%s: Illegal - MUST be empty\n", ops->s));
                return rc;