]> The Tcpdump Group git mirrors - tcpdump/commitdiff
fix bgp COMMUNITIES attribute dump.
authoritojun <itojun>
Tue, 25 Jan 2000 09:23:10 +0000 (09:23 +0000)
committeritojun <itojun>
Tue, 25 Jan 2000 09:23:10 +0000 (09:23 +0000)
print-bgp.c

index e7ecfa4c33bc0ba4eabd21adf1835cb4591ef562..5615e52bb007980379ce43bd214fb2638789fb02 100644 (file)
@@ -33,7 +33,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-     "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.11 2000-01-17 06:24:24 itojun Exp $";
+     "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.12 2000-01-25 09:23:10 itojun Exp $";
 #endif
 
 #include <sys/param.h>
@@ -387,7 +387,7 @@ bgp_attr_print(const struct bgp_attr *attr, const u_char *dat, int len)
                        printf(" invalid len");
                        break;
                }
-               for (i = 0; i < len; i++) {
+               for (i = 0; i < len; i += 4) {
                        u_int32_t comm;
                        comm = (u_int32_t)ntohl(*(u_int32_t *)&p[i]);
                        switch (comm) {
@@ -402,7 +402,7 @@ bgp_attr_print(const struct bgp_attr *attr, const u_char *dat, int len)
                                break;
                        default:
                                printf(" (AS #%d value 0x%04x)",
-                                       (comm >> 16) & 0xffff, comm & 0xfffff);
+                                       (comm >> 16) & 0xffff, comm & 0xffff);
                                break;
                        }
                }