]> 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:07:07 +0000 (16:07 +0200)
print-ppp.c

index 8e63b4a1027e72ff50c0fd66f39adc67ef765bf2..aba243ddb6f252251be5649fa5decdeccf0b4e4a 100644 (file)
@@ -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);