mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 19:39:28 +00:00
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>
This commit is contained in:
parent
c479e75665
commit
137147c66a
@ -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)" : "");
|
||||
}
|
||||
|
@ -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",
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
14
bgpd/bgpd.c
14
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user