diff options
author | Wataru Tanitsu <wataru@ate-mahoroba.jp> | 2010-09-10 09:47:56 -0700 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2011-03-21 13:15:32 +0000 |
commit | c099baf6f0a6509d70fb62a8d6341432abb50d91 (patch) | |
tree | 2fb2449dbf00789ca69cbd6a9dd9bb3f65d5bc1f | |
parent | 7badc26301c8063dc2c6f171c11f9af4f3d0df20 (diff) |
bgpd: Fix display of unsigned attributes
* 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.
-rw-r--r-- | bgpd/bgp_route.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index fd51ad1a..39de4950 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -5729,12 +5729,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, " "); @@ -5794,16 +5794,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) @@ -6073,15 +6073,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"); |