From: Michal Sekletar Date: Fri, 14 Oct 2011 03:10:11 +0000 (-0700) Subject: Remove unnecessary test. X-Git-Tag: tcpdump-4.2.1~13 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/58ed5c2fc8227f64624e55d832c1785c22efbb5a Remove unnecessary test. Also, from me: add a comment explaining why the test isn't being done. Reviewed-by: Guy Harris --- diff --git a/CREDITS b/CREDITS index 205af0fe..9e7e8757 100644 --- a/CREDITS +++ b/CREDITS @@ -127,6 +127,7 @@ Additional people who have contributed patches: Michael Shalayeff Michael Shields Michael T. Stolarchuk + Michal Sekletar Michele "mydecay" Marchetto Mike Frysinger Minto Jeyananth diff --git a/print-atm.c b/print-atm.c index 135898ba..935d1827 100644 --- a/print-atm.c +++ b/print-atm.c @@ -270,10 +270,12 @@ sig_print(const u_char *p, int caplen) printf(":%s ", tok2str(msgtype2str, "msgtype#%d", p[MSG_TYPE_POS])); - if (caplen < CALL_REF_POS+3) { - printf("[|atm]"); - return; - } + /* + * The call reference comes before the message type, + * so if we know we have the message type, which we + * do from the caplen test above, we also know we have + * the call reference. + */ call_ref = EXTRACT_24BITS(&p[CALL_REF_POS]); printf("CALL_REF:0x%06x", call_ref); } else {