From: Francois-Xavier Le Bail Date: Sun, 3 Jul 2022 14:05:38 +0000 (+0200) Subject: PPP: Don't process further if protocol is unknown (-e option) X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/12cded832955715210bcfc4aebbdc70ad366bf97 PPP: Don't process further if protocol is unknown (-e option) --- diff --git a/print-ppp.c b/print-ppp.c index 8e63b4a1..aba243dd 100644 --- a/print-ppp.c +++ b/print-ppp.c @@ -1570,11 +1570,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);