diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-02-14 06:14:03 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-02-14 14:44:27 +0100 |
commit | 137147c66a8a81025d26bd62d05641d18d7a0ad4 (patch) | |
tree | ad9e4e6b05bf93646575754c82608099f7ad4ac9 | |
parent | zebra: Add vrf name to debug output (diff) | |
download | frr-137147c66a8a81025d26bd62d05641d18d7a0ad4.tar.xz frr-137147c66a8a81025d26bd62d05641d18d7a0ad4.zip |
bgpd: Print out vrf name as well as id
The vrf_id is not enough context for people. Use the
actual name of the vrf if you can.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r-- | bgpd/bgp_bfd.c | 13 | ||||
-rw-r--r-- | bgpd/bgp_pbr.c | 9 | ||||
-rw-r--r-- | bgpd/bgp_route.c | 9 | ||||
-rw-r--r-- | bgpd/bgpd.c | 14 |
4 files changed, 32 insertions, 13 deletions
diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index 80ef43f0d..1f650aaeb 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -329,19 +329,22 @@ static int bgp_bfd_dest_update(ZAPI_CALLBACK_ARGS) &remote_cbit, vrf_id); if (BGP_DEBUG(zebra, ZEBRA)) { + struct vrf *vrf; char buf[2][PREFIX2STR_BUFFER]; + + vrf = vrf_lookup_by_id(vrf_id); prefix2str(&dp, buf[0], sizeof(buf[0])); if (ifp) { zlog_debug( - "Zebra: vrf %u interface %s bfd destination %s %s %s", - vrf_id, ifp->name, buf[0], - bfd_get_status_str(status), + "Zebra: vrf %s(%u) interface %s bfd destination %s %s %s", + VRF_LOGNAME(vrf), vrf_id, ifp->name, + buf[0], bfd_get_status_str(status), remote_cbit ? "(cbit on)" : ""); } else { prefix2str(&sp, buf[1], sizeof(buf[1])); zlog_debug( - "Zebra: vrf %u source %s bfd destination %s %s %s", - vrf_id, buf[1], buf[0], + "Zebra: vrf %s(%u) source %s bfd destination %s %s %s", + VRF_LOGNAME(vrf), vrf_id, buf[1], buf[0], bfd_get_status_str(status), remote_cbit ? "(cbit on)" : ""); } diff --git a/bgpd/bgp_pbr.c b/bgpd/bgp_pbr.c index eea20d721..172ec8b42 100644 --- a/bgpd/bgp_pbr.c +++ b/bgpd/bgp_pbr.c @@ -1403,11 +1403,16 @@ void bgp_pbr_print_policy_route(struct bgp_pbr_entry_main *api) ptr += sprintf(ptr, "@redirect ip nh %s", local_buff); break; - case ACTION_REDIRECT: + case ACTION_REDIRECT: { + struct vrf *vrf; + + vrf = vrf_lookup_by_id(api->actions[i].u.redirect_vrf); INCREMENT_DISPLAY(ptr, nb_items); - ptr += sprintf(ptr, "@redirect vrf %u", + ptr += sprintf(ptr, "@redirect vrf %s(%u)", + VRF_LOGNAME(vrf), api->actions[i].u.redirect_vrf); break; + } case ACTION_MARKING: INCREMENT_DISPLAY(ptr, nb_items); ptr += sprintf(ptr, "@set dscp %u", diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 755024f4b..f6ba28b26 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -8867,8 +8867,13 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, } else { if (nexthop_vrfid == VRF_UNKNOWN) vty_out(vty, " vrf ?"); - else - vty_out(vty, " vrf %u", nexthop_vrfid); + else { + struct vrf *vrf; + + vrf = vrf_lookup_by_id(nexthop_vrfid); + vty_out(vty, " vrf %s(%u)", + VRF_LOGNAME(vrf), nexthop_vrfid); + } } } diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 34581b66f..9ac3cce86 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -284,8 +284,11 @@ void bgp_router_id_zebra_bump(vrf_id_t vrf_id, const struct prefix *router_id) */ if (bgp->established_peers == 0) { if (BGP_DEBUG(zebra, ZEBRA)) - zlog_debug("RID change : vrf %u, RTR ID %s", - bgp->vrf_id, inet_ntoa(*addr)); + zlog_debug( + "RID change : vrf %s(%u), RTR ID %s", + bgp->name_pretty, + bgp->vrf_id, + inet_ntoa(*addr)); bgp_router_id_set(bgp, addr, false); } } @@ -304,8 +307,11 @@ void bgp_router_id_zebra_bump(vrf_id_t vrf_id, const struct prefix *router_id) */ if (bgp->established_peers == 0) { if (BGP_DEBUG(zebra, ZEBRA)) - zlog_debug("RID change : vrf %u, RTR ID %s", - bgp->vrf_id, inet_ntoa(*addr)); + zlog_debug( + "RID change : vrf %s(%u), RTR ID %s", + bgp->name_pretty, + bgp->vrf_id, + inet_ntoa(*addr)); bgp_router_id_set(bgp, addr, false); } } |