]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-cdp.c
Use "len", not "payload_len", as we step through the packet; use
[tcpdump] / print-cdp.c
index 4948cf89621805874302268ba343678c02904b2b..fdc62e89375d55b4048f1d21e28bc650020d3234 100644 (file)
@@ -25,8 +25,8 @@
  */
 
 #ifndef lint
-static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.18 2002-11-10 21:32:53 hannes Exp $";
+static const char rcsid[] _U_ =
+    "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.21 2003-11-16 09:36:15 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -141,9 +141,9 @@ cdp_print(const u_char *pptr, u_int length, u_int caplen)
                        printf("'%.*s'", len, tptr);
                        break;
                     case 0x04: /* Capabilities */
-                       printf("(0x%02x): %s",
-                               *(tptr + 3),
-                               bittok2str(cdp_capability_values, "none",*(tptr + 3)));
+                       printf("(0x%08x): %s",
+                               EXTRACT_32BITS(tptr),
+                               bittok2str(cdp_capability_values, "none",EXTRACT_32BITS(tptr)));
                        break;
                     case 0x05: /* Version */
                         printf("\n\t  ");