X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/d9dbb118f2f9c09a8548a2b34a6573f611c0bcf7..3d6e7bd1e42a7316fb2020348a8d3e86b1346b36:/print-atm.c diff --git a/print-atm.c b/print-atm.c index 058541c2..bfaa9ea4 100644 --- a/print-atm.c +++ b/print-atm.c @@ -262,7 +262,7 @@ atm_if_print(netdissect_options *ndo, if (*p == LLC_UI) { if (ndo->ndo_eflag) ND_PRINT((ndo, "CNLPID ")); - isoclns_print(ndo, p + 1, length - 1, caplen - 1); + isoclns_print(ndo, p + 1, length - 1); return hdrlen; } @@ -345,24 +345,18 @@ static const struct tok msgtype2str[] = { static void sig_print(netdissect_options *ndo, - const u_char *p, int caplen) + const u_char *p) { uint32_t call_ref; - if (caplen < PROTO_POS) { - ND_PRINT((ndo, "%s", tstr)); - return; - } + ND_TCHECK(p[PROTO_POS]); if (p[PROTO_POS] == Q2931) { /* * protocol:Q.2931 for User to Network Interface * (UNI 3.1) signalling */ ND_PRINT((ndo, "Q.2931")); - if (caplen < MSG_TYPE_POS) { - ND_PRINT((ndo, " %s", tstr)); - return; - } + ND_TCHECK(p[MSG_TYPE_POS]); ND_PRINT((ndo, ":%s ", tok2str(msgtype2str, "msgtype#%d", p[MSG_TYPE_POS]))); @@ -378,6 +372,10 @@ sig_print(netdissect_options *ndo, /* SCCOP with some unknown protocol atop it */ ND_PRINT((ndo, "SSCOP, proto %d ", p[PROTO_POS])); } + return; + +trunc: + ND_PRINT((ndo, " %s", tstr)); } /* @@ -395,7 +393,7 @@ atm_print(netdissect_options *ndo, switch (vci) { case VCI_PPC: - sig_print(ndo, p, caplen); + sig_print(ndo, p); return; case VCI_BCC: