bugfix: we truncate the iso nsap strings by one byte, print next-hop length in the MP_REACH attribute

This commit is contained in:
hannes 2005-06-03 07:28:24 +00:00
parent af9f8b63e5
commit 8bf0956a98

View File

@ -36,7 +36,7 @@
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.96 2005-05-18 19:58:36 hannes Exp $";
"@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.97 2005-06-03 07:28:24 hannes Exp $";
#endif
#include <tcpdump-stdinc.h>
@ -791,7 +791,7 @@ decode_clnp_prefix(const u_char *pptr, char *buf, u_int buflen)
((0xff00 >> (plen % 8)) & 0xff);
}
snprintf(buf, buflen, "%s/%d",
isonsap_string(addr,(plen + 7) / 8 - 1),
isonsap_string(addr,(plen + 7) / 8),
plen);
return 1 + (plen + 7) / 8;
@ -824,7 +824,7 @@ decode_labeled_vpn_clnp_prefix(const u_char *pptr, char *buf, u_int buflen)
/* the label may get offsetted by 4 bits so lets shift it right */
snprintf(buf, buflen, "RD: %s, %s/%d, label:%u %s",
bgp_vpn_rd_print(pptr+4),
isonsap_string(addr,(plen + 7) / 8 - 1),
isonsap_string(addr,(plen + 7) / 8),
plen,
EXTRACT_24BITS(pptr+1)>>4,
((pptr[3]&1)==0) ? "(BOGUS: Bottom of Stack NOT set!)" : "(bottom)" );
@ -840,7 +840,7 @@ bgp_attr_print(const struct bgp_attr *attr, const u_char *pptr, int len)
{
int i;
u_int16_t af;
u_int8_t safi, snpa;
u_int8_t safi, snpa, nhlen;
union { /* copy buffer for bandwidth values */
float f;
u_int32_t i;
@ -1031,7 +1031,8 @@ bgp_attr_print(const struct bgp_attr *attr, const u_char *pptr, int len)
tptr +=3;
TCHECK(tptr[0]);
tlen = tptr[0];
nhlen = tptr[0];
tlen = nhlen;
tptr++;
if (tlen) {
@ -1157,6 +1158,7 @@ bgp_attr_print(const struct bgp_attr *attr, const u_char *pptr, int len)
}
}
}
printf(", nh-length: %u", nhlen);
tptr += tlen;
TCHECK(tptr[0]);