]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-chdlc.c
add support for AS-PIC cookies
[tcpdump] / print-chdlc.c
index 8b32cf91160ac7853badacfb6f40a59ff9df3077..ea1a197af81328e87d608c561049583dfed71859 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.32.2.5 2005-04-26 09:42:44 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.32.2.7 2005-04-27 14:35:56 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -134,7 +134,7 @@ struct cisco_slarp {
 };
 
 #define SLARP_MIN_LEN  14
-#define SLARP_LEN      18
+#define SLARP_MAX_LEN  18
 
 static void
 chdlc_slarp_print(const u_char *cp, u_int length)
@@ -172,7 +172,7 @@ chdlc_slarp_print(const u_char *cp, u_int length)
                        EXTRACT_32BITS(&slarp->un.keep.yourseq),
                        EXTRACT_16BITS(&slarp->un.keep.rel));
 
-                if (length >= SLARP_MIN_LEN) { /* uptime-stamp is optional */
+                if (length >= SLARP_MAX_LEN) { /* uptime-stamp is optional */
                         cp += SLARP_MIN_LEN;
                         if (!TTEST2(*cp, 4))
                                 goto trunc;
@@ -190,8 +190,8 @@ chdlc_slarp_print(const u_char *cp, u_int length)
                break;
        }
 
-       if (SLARP_LEN < length && vflag)
-               printf(", (trailing junk: %d bytes)", length - SLARP_LEN);
+       if (SLARP_MAX_LEN < length && vflag)
+               printf(", (trailing junk: %d bytes)", length - SLARP_MAX_LEN);
         if (vflag > 1)
             print_unknown_data(cp+4,"\n\t",length-4);
        return;