From: Milan Kocian Date: Mon, 1 Dec 2014 12:48:25 +0000 (+0000) Subject: bgpd: fix negative values in output X-Git-Tag: frr-2.0-rc1~637 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=4a7ac06c5ce3f6bdc0859f32effede3e34982ea7;p=matthieu%2Ffrr.git bgpd: fix negative values in output 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 Signed-off-by: David Lamparter (cherry picked from commit cb4fc59c8a0f9df81109d38acbeaab5627e361f5) Conflicts: bgpd/bgp_vty.c --- diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c index b60cbd0854..dc0137fd19 100644 --- a/bgpd/bgp_ecommunity.c +++ b/bgpd/bgp_ecommunity.c @@ -714,7 +714,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; @@ -729,7 +729,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; @@ -741,7 +741,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; diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 825f5954c2..ea7fbe0ce1 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -9802,7 +9802,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, json_object *json_peers = NULL; /* 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"; if (use_json) {