]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd, zebra: Fix format for some metric outputs
authorJorge Boncompte [DTI2] <jorge@dti2.net>
Fri, 13 Apr 2012 11:46:07 +0000 (13:46 +0200)
committerDavid Lamparter <equinox@diac24.net>
Wed, 2 May 2012 15:03:21 +0000 (17:03 +0200)
Metrics are unsigned values.

  * bgpd/bgp_{debug,route,vty}.c,
  * zebra/zebra_vty.c: replace %d with %u for metrics & distances

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
[reworded commit message]
Signed-off-by: David Lamparter <equinox@diac24.net>
bgpd/bgp_debug.c
bgpd/bgp_route.c
bgpd/bgp_vty.c
zebra/zebra_vty.c

index 8e16186458f25b3318ebfe2006768f3929d58960..e3e3ec86f577989c4828707dade3e8419429c4c8 100644 (file)
@@ -194,11 +194,11 @@ bgp_dump_attr (struct peer *peer, struct attr *attr, char *buf, size_t size)
 #endif /* HAVE_IPV6 */
 
   if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_LOCAL_PREF)))
-    snprintf (buf + strlen (buf), size - strlen (buf), ", localpref %d",
+    snprintf (buf + strlen (buf), size - strlen (buf), ", localpref %u",
              attr->local_pref);
 
   if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_MULTI_EXIT_DISC))) 
-    snprintf (buf + strlen (buf), size - strlen (buf), ", metric %d",
+    snprintf (buf + strlen (buf), size - strlen (buf), ", metric %u",
              attr->med);
 
   if (CHECK_FLAG (attr->flag, ATTR_FLAG_BIT (BGP_ATTR_COMMUNITIES))) 
index 087f83961446e6c5f3d23608e55a2d0bce1faf33..9f8d82327fabba5065394b8173c38ad3504fe5f1 100644 (file)
@@ -5954,7 +5954,7 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p,
          if (! CHECK_FLAG (binfo->flags, BGP_INFO_VALID))
            vty_out (vty, " (inaccessible)"); 
          else if (binfo->extra && binfo->extra->igpmetric)
-           vty_out (vty, " (metric %d)", binfo->extra->igpmetric);
+           vty_out (vty, " (metric %u)", binfo->extra->igpmetric);
          vty_out (vty, " from %s", sockunion2str (&binfo->peer->su, buf, SU_ADDRSTRLEN));
          if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID))
            vty_out (vty, " (%s)", inet_ntoa (attr->extra->originator_id));
index cbe0b44346464ecbaf5d682be9de9cca23f4647d..bba1c7de6ec355364c70da0a6c7ff280322e66e1 100644 (file)
@@ -8966,7 +8966,7 @@ bgp_config_write_redistribute (struct vty *vty, struct bgp *bgp, afi_t afi,
          vty_out (vty, " redistribute %s", zebra_route_string(i));
 
          if (bgp->redist_metric_flag[afi][i])
-           vty_out (vty, " metric %d", bgp->redist_metric[afi][i]);
+           vty_out (vty, " metric %u", bgp->redist_metric[afi][i]);
 
          if (bgp->rmap[afi][i].name)
            vty_out (vty, " route-map %s", bgp->rmap[afi][i].name);
index dafcf75aff9d60eb8f3b0df88803e2f8a1fce60d..8a57be91672a9c53664aca005f9f9faca13c3460 100644 (file)
@@ -541,7 +541,7 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn)
               inet_ntoa (rn->p.u.prefix4), rn->p.prefixlen,
               VTY_NEWLINE);
       vty_out (vty, "  Known via \"%s\"", zebra_route_string (rib->type));
-      vty_out (vty, ", distance %d, metric %d", rib->distance, rib->metric);
+      vty_out (vty, ", distance %u, metric %u", rib->distance, rib->metric);
       if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
        vty_out (vty, ", best");
       if (rib->refcnt)
@@ -1519,7 +1519,7 @@ vty_show_ipv6_route_detail (struct vty *vty, struct route_node *rn)
               rn->p.prefixlen,
               VTY_NEWLINE);
       vty_out (vty, "  Known via \"%s\"", zebra_route_string (rib->type));
-      vty_out (vty, ", distance %d, metric %d", rib->distance, rib->metric);
+      vty_out (vty, ", distance %u, metric %u", rib->distance, rib->metric);
       if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED))
        vty_out (vty, ", best");
       if (rib->refcnt)