summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorJorge Boncompte [DTI2] <jorge@dti2.net>2012-04-13 13:46:07 +0200
committerDavid Lamparter <equinox@diac24.net>2012-05-02 17:03:21 +0200
commitddc943dec3c017583f81cce388c7d453293156c7 (patch)
treea36d2bca91b1f3a7545a135b3bafccc40d0ca47b /bgpd
parent8794e8d229dc9fe29ea31424883433d4880ef408 (diff)
bgpd, zebra: Fix format for some metric outputs
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>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_debug.c4
-rw-r--r--bgpd/bgp_route.c2
-rw-r--r--bgpd/bgp_vty.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c
index 8e161864..e3e3ec86 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 087f8396..9f8d8232 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -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));
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index cbe0b443..bba1c7de 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -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);