X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/59864b113d8f2310a38d916e11a27c6f7e979ad9..refs/pull/482/head:/print-atm.c?ds=sidebyside diff --git a/print-atm.c b/print-atm.c index 82a012ba..7489158b 100644 --- a/print-atm.c +++ b/print-atm.c @@ -23,9 +23,9 @@ #include "config.h" #endif -#include +#include -#include "interface.h" +#include "netdissect.h" #include "extract.h" #include "addrtoname.h" #include "atm.h" @@ -214,15 +214,20 @@ static const struct tok *oam_functype_values[16] = { /* * Print an RFC 1483 LLC-encapsulated ATM frame. */ -static void +static u_int atm_llc_print(netdissect_options *ndo, const u_char *p, int length, int caplen) { - if (!llc_print(ndo, p, length, caplen, NULL, NULL)) { - /* ether_type not known, print raw packet */ + int llc_hdrlen; + + llc_hdrlen = llc_print(ndo, p, length, caplen, NULL, NULL); + if (llc_hdrlen < 0) { + /* packet not known, print raw packet */ if (!ndo->ndo_suppress_default_print) ND_DEFAULTPRINT(p, caplen); + llc_hdrlen = -llc_hdrlen; } + return (llc_hdrlen); } /* @@ -310,7 +315,7 @@ atm_if_print(netdissect_options *ndo, caplen -= 20; hdrlen += 20; } - atm_llc_print(ndo, p, length, caplen); + hdrlen += atm_llc_print(ndo, p, length, caplen); return (hdrlen); }