]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Fix display of unsigned attributes
authorWataru Tanitsu <wataru@ate-mahoroba.jp>
Fri, 10 Sep 2010 16:47:56 +0000 (09:47 -0700)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 1 Aug 2011 11:36:36 +0000 (15:36 +0400)
* bgp_route.c: (route_vty_out*) The local prefix, metric and weight values
  are all stored as uint32_t.  Change the format to %u so that large values
  are not displayed as negative integers.

bgpd/bgp_route.c

index cfaf1b6ff478d127636814cd5233e1da8f7e79dd..de1c000f6070c7d81b275a38cefa633b1dc31db1 100644 (file)
@@ -5543,12 +5543,12 @@ route_vty_out (struct vty *vty, struct prefix *p,
 #endif /* HAVE_IPV6 */
 
       if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC))
-       vty_out (vty, "%10d", attr->med);
+       vty_out (vty, "%10u", attr->med);
       else
        vty_out (vty, "          ");
 
       if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_LOCAL_PREF))
-       vty_out (vty, "%7d", attr->local_pref);
+       vty_out (vty, "%7u", attr->local_pref);
       else
        vty_out (vty, "       ");
 
@@ -5608,16 +5608,16 @@ route_vty_out_tmp (struct vty *vty, struct prefix *p,
 #endif /* HAVE_IPV6 */
 
       if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC))
-       vty_out (vty, "%10d", attr->med);
+       vty_out (vty, "%10u", attr->med);
       else
        vty_out (vty, "          ");
 
       if (attr->flag & ATTR_FLAG_BIT (BGP_ATTR_LOCAL_PREF))
-       vty_out (vty, "%7d", attr->local_pref);
+       vty_out (vty, "%7u", attr->local_pref);
       else
        vty_out (vty, "       ");
       
-      vty_out (vty, "%7d ", (attr->extra ? attr->extra->weight : 0));
+      vty_out (vty, "%7u ", (attr->extra ? attr->extra->weight : 0));
       
       /* Print aspath */
       if (attr->aspath)
@@ -5884,15 +5884,15 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
       vty_out (vty, "      Origin %s", bgp_origin_long_str[attr->origin]);
          
       if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC))
-       vty_out (vty, ", metric %d", attr->med);
+       vty_out (vty, ", metric %u", attr->med);
          
       if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF))
-       vty_out (vty, ", localpref %d", attr->local_pref);
+       vty_out (vty, ", localpref %u", attr->local_pref);
       else
-       vty_out (vty, ", localpref %d", bgp->default_local_pref);
+       vty_out (vty, ", localpref %u", bgp->default_local_pref);
 
       if (attr->extra && attr->extra->weight != 0)
-       vty_out (vty, ", weight %d", attr->extra->weight);
+       vty_out (vty, ", weight %u", attr->extra->weight);
        
       if (! CHECK_FLAG (binfo->flags, BGP_INFO_HISTORY))
        vty_out (vty, ", valid");