diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-04-17 18:38:46 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-04-17 18:38:46 -0700 |
commit | 59864b113d8f2310a38d916e11a27c6f7e979ad9 (patch) | |
tree | 1ffb8db59e76d121389ec416fdca8dfff1c25764 /print-token.c | |
parent | ce0f6c9687a93d3959276de95f9b656d014a050e (diff) | |
download | tcpdump-59864b113d8f2310a38d916e11a27c6f7e979ad9.tar.gz |
Clean up printing of LLC packets.
Don't print LLC header information for SNAP packets; if we have a SNAP
header, just call snap_print() and return its return value, regardless
of whether it's 1 or 0, don't fall into the code to print raw LLC header
information - and don't print it with -e, either.
If llc_print() returns 0, just call the default packet printer, don't
print the MAC-layer header or the extracted ethertype - llc_print() will
print the source and destination MAC addresses and whatever type
information is in the LLC or SNAP headers.
If we don't know the DSAP/LSAP, and it's an information frame (numbered
or not) and not an XID frame, return 0, so that we give a hex dump of
the raw payload.
In addition, print the length when printing SNAP header information with
-e.
Diffstat (limited to 'print-token.c')
-rw-r--r-- | print-token.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/print-token.c b/print-token.c index 33647a14..9a0e9742 100644 --- a/print-token.c +++ b/print-token.c @@ -148,7 +148,6 @@ u_int token_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen) { const struct token_header *trp; - u_short extracted_ethertype; struct ether_header ehdr; u_int route_len = 0, hdr_len = TOKEN_HDRLEN; int seg; @@ -210,17 +209,8 @@ token_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen /* Frame Control field determines interpretation of packet */ if (FRAME_TYPE(trp) == TOKEN_FC_LLC) { /* Try to print the LLC-layer header & higher layers */ - if (llc_print(ndo, p, length, caplen, ESRC(&ehdr), EDST(&ehdr), - &extracted_ethertype) == 0) { + if (llc_print(ndo, p, length, caplen, ESRC(&ehdr), EDST(&ehdr)) == 0) { /* ether_type not known, print raw packet */ - if (!ndo->ndo_eflag) - token_hdr_print(ndo, trp, - length + TOKEN_HDRLEN + route_len, - ESRC(&ehdr), EDST(&ehdr)); - if (extracted_ethertype) { - ND_PRINT((ndo, "(LLC %s) ", - etherproto_string(htons(extracted_ethertype)))); - } if (!ndo->ndo_suppress_default_print) ND_DEFAULTPRINT(p, caplen); } |