]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Juniper: Avoid testing ndo->ndo_eflag > 1
authorFrancois-Xavier Le Bail <[email protected]>
Sat, 5 Dec 2020 15:02:55 +0000 (16:02 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sat, 5 Dec 2020 15:21:48 +0000 (16:21 +0100)
It's the only case where ndo->ndo_eflag is tested > 1.
It's not documented we could use -ee[...].

To print more details, we already have -v[v]... (if needed).
Using -e[e]... could add some confusion.
This also add more complexity on a test matrix:
('', '-v', '-e', '-ve', -'vee', -vve, '-vvee', etc.).

Thus replace this only case by ndo->ndo_eflag to only have to test
ndo_eflag == 0 or ndo_eflag == 1.

print-juniper.c

index 1560cee554dc7db0cc012b5075364779eb87f7c2..dafe48fa72b0f9cb24e9c8d44e18dea22c556324 100644 (file)
@@ -1584,7 +1584,7 @@ juniper_parse_header(netdissect_options *ndo,
         break;
     }
 
-    if (ndo->ndo_eflag > 1)
+    if (ndo->ndo_eflag)
         ND_PRINT("hlen %u, proto 0x%04x, ", l2info->header_len, l2info->proto);
 
     return 1; /* everything went ok so far. continue parsing */