]> The Tcpdump Group git mirrors - tcpdump/commitdiff
PPP: Don't process further if protocol is unknown (-e option)
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 3 Jul 2022 14:05:38 +0000 (16:05 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 3 Jul 2022 14:10:07 +0000 (16:10 +0200)
(cherry picked from commit 12cded832955715210bcfc4aebbdc70ad366bf97)

print-ppp.c

index 428fd745665cd59c080ec75cff98f84e7b5a8fbe..68aad9851f38c35501d2ae00ece2e8749a0e94b5 100644 (file)
@@ -1565,11 +1565,18 @@ ppp_print(netdissect_options *ndo,
                hdr_len += 2;
        }
 
-       if (ndo->ndo_eflag)
-               ND_PRINT("%s (0x%04x), length %u: ",
-                         tok2str(ppptype2str, "unknown", proto),
+       if (ndo->ndo_eflag) {
+               const char *typestr;
+               typestr = tok2str(ppptype2str, "unknown", proto);
+               ND_PRINT("%s (0x%04x), length %u",
+                         typestr,
                          proto,
                          olen);
+               if (*typestr == 'u')    /* "unknown" */
+                       return hdr_len;
+
+               ND_PRINT(": ");
+       }
 
        handle_ppp(ndo, proto, p, length);
        return (hdr_len);