]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix negative values in output
authorMilan Kocian <milon@wq.cz>
Mon, 1 Dec 2014 12:48:25 +0000 (12:48 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Fri, 3 Jun 2016 20:50:13 +0000 (20:50 +0000)
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 <milon@wq.cz>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit cb4fc59c8a0f9df81109d38acbeaab5627e361f5)

Conflicts:
bgpd/bgp_vty.c

bgpd/bgp_ecommunity.c
bgpd/bgp_vty.c

index b60cbd0854bfd2eb1e411a7772657320787c2d15..dc0137fd19e146689c4536ebee96a44f5e2555f2 100644 (file)
@@ -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;
index 825f5954c235cbfac7e2266b5d5240e31aecd3f4..ea7fbe0ce1e2226f9470d6938e37f968a02ab918 100644 (file)
@@ -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)
     {