diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-02-14 14:41:04 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-02-14 14:41:42 +0100 |
commit | c479e7566592d91bd98b5de061ec75ffce19d116 (patch) | |
tree | ff84acbe6cf6ecd5bb341099de001d9085ef684a | |
parent | ripngd: Add vrf name to debug output (diff) | |
download | frr-c479e7566592d91bd98b5de061ec75ffce19d116.tar.xz frr-c479e7566592d91bd98b5de061ec75ffce19d116.zip |
zebra: Add vrf name to debug output
The vrf id is insufficient of a discriminator in people's head
Give them what they need.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r-- | zebra/interface.c | 38 | ||||
-rw-r--r-- | zebra/redistribute.c | 11 | ||||
-rw-r--r-- | zebra/zapi_msg.c | 6 | ||||
-rw-r--r-- | zebra/zebra_ptm.c | 6 | ||||
-rw-r--r-- | zebra/zebra_rib.c | 5 |
5 files changed, 43 insertions, 23 deletions
diff --git a/zebra/interface.c b/zebra/interface.c index 7e7397a3b..a434ba0d3 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -617,11 +617,14 @@ void if_add_update(struct interface *ifp) SET_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE); if (if_data->shutdown == IF_ZEBRA_SHUTDOWN_ON) { - if (IS_ZEBRA_DEBUG_KERNEL) + if (IS_ZEBRA_DEBUG_KERNEL) { zlog_debug( - "interface %s vrf %u index %d is shutdown. " + "interface %s vrf %s(%u) index %d is shutdown. " "Won't wake it up.", - ifp->name, ifp->vrf_id, ifp->ifindex); + ifp->name, VRF_LOGNAME(zvrf->vrf), + ifp->vrf_id, ifp->ifindex); + } + return; } @@ -629,13 +632,15 @@ void if_add_update(struct interface *ifp) if (IS_ZEBRA_DEBUG_KERNEL) zlog_debug( - "interface %s vrf %u index %d becomes active.", - ifp->name, ifp->vrf_id, ifp->ifindex); + "interface %s vrf %s(%u) index %d becomes active.", + ifp->name, VRF_LOGNAME(zvrf->vrf), ifp->vrf_id, + ifp->ifindex); } else { if (IS_ZEBRA_DEBUG_KERNEL) - zlog_debug("interface %s vrf %u index %d is added.", - ifp->name, ifp->vrf_id, ifp->ifindex); + zlog_debug("interface %s vrf %s(%u) index %d is added.", + ifp->name, VRF_LOGNAME(zvrf->vrf), + ifp->vrf_id, ifp->ifindex); } } @@ -774,10 +779,12 @@ void if_delete_update(struct interface *ifp) struct zebra_if *zif; if (if_is_up(ifp)) { + struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id); + flog_err( EC_LIB_INTERFACE, - "interface %s vrf %u index %d is still up while being deleted.", - ifp->name, ifp->vrf_id, ifp->ifindex); + "interface %s vrf %s(%u) index %d is still up while being deleted.", + ifp->name, VRF_LOGNAME(vrf), ifp->vrf_id, ifp->ifindex); return; } @@ -787,9 +794,13 @@ void if_delete_update(struct interface *ifp) /* Mark interface as inactive */ UNSET_FLAG(ifp->status, ZEBRA_INTERFACE_ACTIVE); - if (IS_ZEBRA_DEBUG_KERNEL) - zlog_debug("interface %s vrf %u index %d is now inactive.", - ifp->name, ifp->vrf_id, ifp->ifindex); + if (IS_ZEBRA_DEBUG_KERNEL) { + struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id); + + zlog_debug("interface %s vrf %s(%u) index %d is now inactive.", + ifp->name, VRF_LOGNAME(vrf), ifp->vrf_id, + ifp->ifindex); + } /* Delete connected routes from the kernel. */ if_delete_connected(ifp); @@ -1863,7 +1874,8 @@ DEFUN (show_interface_desc_vrf_all, RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) if (!RB_EMPTY(if_name_head, &vrf->ifaces_by_name)) { - vty_out(vty, "\n\tVRF %u\n\n", vrf->vrf_id); + vty_out(vty, "\n\tVRF %s(%u)\n\n", VRF_LOGNAME(vrf), + vrf->vrf_id); if_show_description(vty, vrf->vrf_id); } diff --git a/zebra/redistribute.c b/zebra/redistribute.c index b891fb121..03bb19923 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -339,9 +339,10 @@ void zebra_redistribute_add(ZAPI_HANDLER_ARGS) if (IS_ZEBRA_DEBUG_EVENT) zlog_debug( - "%s: client proto %s afi=%d, wants %s, vrf %u, instance=%d", + "%s: client proto %s afi=%d, wants %s, vrf %s(%u), instance=%d", __func__, zebra_route_string(client->proto), afi, - zebra_route_string(type), zvrf_id(zvrf), instance); + zebra_route_string(type), VRF_LOGNAME(zvrf->vrf), + zvrf_id(zvrf), instance); if (afi == 0 || afi >= AFI_MAX) { flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF, @@ -368,8 +369,10 @@ void zebra_redistribute_add(ZAPI_HANDLER_ARGS) if (!vrf_bitmap_check(client->redist[afi][type], zvrf_id(zvrf))) { if (IS_ZEBRA_DEBUG_EVENT) - zlog_debug("%s: setting vrf %u redist bitmap", - __func__, zvrf_id(zvrf)); + zlog_debug( + "%s: setting vrf %s(%u) redist bitmap", + __func__, VRF_LOGNAME(zvrf->vrf), + zvrf_id(zvrf)); vrf_bitmap_set(client->redist[afi][type], zvrf_id(zvrf)); zebra_redistribute(client, type, 0, zvrf_id(zvrf), afi); diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 4d0e34561..02b8cb972 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1946,6 +1946,7 @@ static void zread_table_manager_connect(struct zserv *client, struct stream *s; uint8_t proto; uint16_t instance; + struct vrf *vrf = vrf_lookup_by_id(vrf_id); s = msg; @@ -1961,8 +1962,9 @@ static void zread_table_manager_connect(struct zserv *client, zsend_table_manager_connect_response(client, vrf_id, 1); return; } - zlog_notice("client %d with vrf %u instance %u connected as %s", - client->sock, vrf_id, instance, zebra_route_string(proto)); + zlog_notice("client %d with vrf %s(%u) instance %u connected as %s", + client->sock, VRF_LOGNAME(vrf), vrf_id, instance, + zebra_route_string(proto)); client->proto = proto; client->instance = instance; diff --git a/zebra/zebra_ptm.c b/zebra/zebra_ptm.c index 681b4d1ab..b80c9026a 100644 --- a/zebra/zebra_ptm.c +++ b/zebra/zebra_ptm.c @@ -441,15 +441,17 @@ static void if_bfd_session_update(struct interface *ifp, struct prefix *dp, dp->prefixlen, ifp->name, bfd_get_status_str(status)); } else { + struct vrf *vrf = vrf_lookup_by_id(vrf_id); + zlog_debug( "MESSAGE: ZEBRA_INTERFACE_BFD_DEST_UPDATE %s/%d " - "with src %s/%d and vrf %u %s event", + "with src %s/%d and vrf %s(%u) %s event", inet_ntop(dp->family, &dp->u.prefix, buf[0], INET6_ADDRSTRLEN), dp->prefixlen, inet_ntop(sp->family, &sp->u.prefix, buf[1], INET6_ADDRSTRLEN), - sp->prefixlen, vrf_id, + sp->prefixlen, VRF_LOGNAME(vrf), vrf_id, bfd_get_status_str(status)); } } diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 57bd98687..7f919e47e 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -2408,13 +2408,14 @@ void _route_entry_dump(const char *func, union prefixconstptr pp, char srcaddr[PREFIX_STRLEN]; char nhname[PREFIX_STRLEN]; struct nexthop *nexthop; + struct vrf *vrf = vrf_lookup_by_id(re->vrf_id); - zlog_debug("%s: dumping RE entry %p for %s%s%s vrf %u", func, + zlog_debug("%s: dumping RE entry %p for %s%s%s vrf %s(%u)", func, (const void *)re, prefix2str(pp, straddr, sizeof(straddr)), is_srcdst ? " from " : "", is_srcdst ? prefix2str(src_pp, srcaddr, sizeof(srcaddr)) : "", - re->vrf_id); + VRF_LOGNAME(vrf), re->vrf_id); zlog_debug("%s: uptime == %lu, type == %u, instance == %d, table == %d", straddr, (unsigned long)re->uptime, re->type, re->instance, re->table); |