Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
bgpd: fix negative values in output
Browse files Browse the repository at this point in the history
Negative value in output of ecommunities (and as numbers)
seems odd :-). This patch fixes it. And add minor formating
modification, better for big as numbers.

Signed-off-by: Milan Kocian <[email protected]>
Signed-off-by: David Lamparter <[email protected]>
  • Loading branch information
milon21 authored and eqvinox committed Feb 6, 2015
1 parent 1436371 commit cb4fc59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions bgpd/bgp_ecommunity.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ ecommunity_ecom2str (struct ecommunity *ecom, int format)
eas.val = (*pnt++ << 8);
eas.val |= (*pnt++);

len = sprintf( str_buf + str_pnt, "%s%u:%d", prefix,
len = sprintf( str_buf + str_pnt, "%s%u:%u", prefix,
eas.as, eas.val );
str_pnt += len;
first = 0;
Expand All @@ -703,7 +703,7 @@ ecommunity_ecom2str (struct ecommunity *ecom, int format)
eas.val |= (*pnt++ << 8);
eas.val |= (*pnt++);

len = sprintf (str_buf + str_pnt, "%s%u:%d", prefix,
len = sprintf (str_buf + str_pnt, "%s%u:%u", prefix,
eas.as, eas.val);
str_pnt += len;
first = 0;
Expand All @@ -715,7 +715,7 @@ ecommunity_ecom2str (struct ecommunity *ecom, int format)
eip.val = (*pnt++ << 8);
eip.val |= (*pnt++);

len = sprintf (str_buf + str_pnt, "%s%s:%d", prefix,
len = sprintf (str_buf + str_pnt, "%s%s:%u", prefix,
inet_ntoa (eip.ip), eip.val);
str_pnt += len;
first = 0;
Expand Down
6 changes: 3 additions & 3 deletions bgpd/bgp_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -6937,7 +6937,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi)
int len;

/* Header string for each address family. */
static char header[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";
static char header[] = "Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd";

for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
Expand Down Expand Up @@ -8302,7 +8302,7 @@ bgp_write_rsclient_summary (struct vty *vty, struct peer *rsclient,

vty_out (vty, "4 ");

vty_out (vty, "%11d ", rsclient->as);
vty_out (vty, "%10u ", rsclient->as);

rmname = ROUTE_MAP_EXPORT_NAME(&rsclient->filter[afi][safi]);
if ( rmname && strlen (rmname) > 13 )
Expand Down Expand Up @@ -8347,7 +8347,7 @@ bgp_show_rsclient_summary (struct vty *vty, struct bgp *bgp,
int count = 0;

/* Header string for each address family. */
static char header[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State";
static char header[] = "Neighbor V AS Export-Policy Import-Policy Up/Down State";

for (ALL_LIST_ELEMENTS (bgp->rsclient, node, nnode, peer))
{
Expand Down

0 comments on commit cb4fc59

Please sign in to comment.