
jorge at dti2
Apr 13, 2012, 4:46 AM
Post #1 of 1
(117 views)
Permalink
|
|
[PATCH] Fix format for some metric outputs
|
|
From: "Jorge Boncompte [DTI2]" <jorge [at] dti2> Metric it's an unsigned value. Signed-off-by: Jorge Boncompte [DTI2] <jorge [at] dti2> --- bgpd/bgp_debug.c | 4 ++-- bgpd/bgp_route.c | 2 +- bgpd/bgp_vty.c | 2 +- zebra/zebra_vty.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index 8e16186..e3e3ec8 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -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))) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index ba53032..b18d5d3 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -5877,7 +5877,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)); diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index f65bb15..5bb1bc9 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -8822,7 +8822,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); diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index dafcf75..8a57be9 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -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) -- 1.7.8.3 _______________________________________________ Quagga-dev mailing list Quagga-dev [at] lists http://lists.quagga.net/mailman/listinfo/quagga-dev
|