From: fenner Date: Mon, 15 Oct 2001 23:27:31 +0000 (+0000) Subject: Fix AS-Path printing; the path segment length is the number of ASs X-Git-Tag: tcpdump-3.7.1~62 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/c48c15c08c96b588408f8eef5828adb2c8da39b5?hp=c8a665cd1ec55d428c93fdb7f8f8139aca8cd095 Fix AS-Path printing; the path segment length is the number of ASs in the path segment, not the number of bytes. Submitted by: Jan Oravec --- diff --git a/CREDITS b/CREDITS index 5eec27ab..dbbb722c 100644 --- a/CREDITS +++ b/CREDITS @@ -30,8 +30,9 @@ Additional people who have contributed patches: Gisle Vanem Hannes Gredler Harry Raaymakers - Jason R. Thorpe Jakob Schlyter + Jan Oravec + Jason R. Thorpe JINMEI Tatuya Jefferson Ogata Jeffrey Hutzelman diff --git a/print-bgp.c b/print-bgp.c index 08522fad..3fc69542 100644 --- a/print-bgp.c +++ b/print-bgp.c @@ -33,7 +33,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.23 2001-09-17 21:57:55 fenner Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.24 2001-10-15 23:27:31 fenner Exp $"; #endif #include @@ -346,7 +346,7 @@ bgp_attr_print(const struct bgp_attr *attr, const u_char *dat, int len) if (p[0] == 3 || p[0] == 4) printf("confed"); printf("%s", (p[0] & 1) ? "{" : ""); - for (i = 0; i < p[1]; i += 2) { + for (i = 0; i < p[1] * 2; i += 2) { printf("%s%u", i == 0 ? "" : " ", EXTRACT_16BITS(&p[2 + i])); }