Merge pull request #1897 from donaldsharp/vrf_knowledge

zebra: Add some additional vrf info to debugs
This commit is contained in:
Lou Berger 2018-03-15 09:01:05 -04:00 committed by GitHub
commit 309d667bcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 24 deletions

View File

@ -685,7 +685,8 @@ struct route_entry *rib_match_ipv4_multicast(vrf_id_t vrf_id,
char buf[BUFSIZ]; char buf[BUFSIZ];
inet_ntop(AF_INET, &addr, buf, BUFSIZ); inet_ntop(AF_INET, &addr, buf, BUFSIZ);
zlog_debug("%s: %s: found %s, using %s", __func__, buf, zlog_debug("%s: %s: vrf: %u found %s, using %s",
__func__, buf, vrf_id,
mre ? (ure ? "MRIB+URIB" : "MRIB") mre ? (ure ? "MRIB+URIB" : "MRIB")
: ure ? "URIB" : "nothing", : ure ? "URIB" : "nothing",
re == ure ? "URIB" : re == mre ? "MRIB" : "none"); re == ure ? "URIB" : re == mre ? "MRIB" : "none");
@ -1608,9 +1609,9 @@ static void rib_process(struct route_node *rn)
if (re != old_selected) { if (re != old_selected) {
if (IS_ZEBRA_DEBUG_RIB) if (IS_ZEBRA_DEBUG_RIB)
zlog_debug( zlog_debug(
"%s: %s: imported via import-table but denied " "%s: %u:%s: imported via import-table but denied "
"by the ip protocol table route-map", "by the ip protocol table route-map",
__func__, buf); __func__, vrf_id, buf);
rib_unlink(rn, re); rib_unlink(rn, re);
} else } else
SET_FLAG(re->status, SET_FLAG(re->status,
@ -2191,9 +2192,9 @@ void _route_entry_dump(const char *func, union prefixconstptr pp,
for (ALL_NEXTHOPS(re->ng, nexthop)) { for (ALL_NEXTHOPS(re->ng, nexthop)) {
inet_ntop(p->family, &nexthop->gate, straddr, INET6_ADDRSTRLEN); inet_ntop(p->family, &nexthop->gate, straddr, INET6_ADDRSTRLEN);
zlog_debug("%s: %s %s[%u] with flags %s%s%s", func, zlog_debug("%s: %s %s[%u] vrf %u with flags %s%s%s", func,
(nexthop->rparent ? " NH" : "NH"), straddr, (nexthop->rparent ? " NH" : "NH"), straddr,
nexthop->ifindex, nexthop->ifindex, nexthop->vrf_id,
(CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE) (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)
? "ACTIVE " ? "ACTIVE "
: ""), : ""),
@ -2221,7 +2222,8 @@ void rib_lookup_and_dump(struct prefix_ipv4 *p, vrf_id_t vrf_id)
/* Lookup table. */ /* Lookup table. */
table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, vrf_id); table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, vrf_id);
if (!table) { if (!table) {
zlog_err("%s: zebra_vrf_table() returned NULL", __func__); zlog_err("%s:%u zebra_vrf_table() returned NULL",
__func__, vrf_id);
return; return;
} }
@ -2230,7 +2232,7 @@ void rib_lookup_and_dump(struct prefix_ipv4 *p, vrf_id_t vrf_id)
/* No route for this prefix. */ /* No route for this prefix. */
if (!rn) { if (!rn) {
zlog_debug("%s: lookup failed for %s", __func__, zlog_debug("%s:%u lookup failed for %s", __func__, vrf_id,
prefix2str((struct prefix *)p, prefix_buf, prefix2str((struct prefix *)p, prefix_buf,
sizeof(prefix_buf))); sizeof(prefix_buf)));
return; return;
@ -2241,8 +2243,9 @@ void rib_lookup_and_dump(struct prefix_ipv4 *p, vrf_id_t vrf_id)
/* let's go */ /* let's go */
RNODE_FOREACH_RE (rn, re) { RNODE_FOREACH_RE (rn, re) {
zlog_debug("%s: rn %p, re %p: %s, %s", __func__, (void *)rn, zlog_debug("%s:%u rn %p, re %p: %s, %s",
(void *)re, __func__, vrf_id,
(void *)rn, (void *)re,
(CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED) (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED)
? "removed" ? "removed"
: "NOT removed"), : "NOT removed"),
@ -2266,7 +2269,8 @@ void rib_lookup_and_pushup(struct prefix_ipv4 *p, vrf_id_t vrf_id)
rib_dest_t *dest; rib_dest_t *dest;
if (NULL == (table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, vrf_id))) { if (NULL == (table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, vrf_id))) {
zlog_err("%s: zebra_vrf_table() returned NULL", __func__); zlog_err("%s:%u zebra_vrf_table() returned NULL",
__func__, vrf_id);
return; return;
} }

View File

@ -663,9 +663,9 @@ int zsend_route_notify_owner(struct route_entry *re, struct prefix *p,
char buff[PREFIX_STRLEN]; char buff[PREFIX_STRLEN];
zlog_debug( zlog_debug(
"Not Notifying Owner: %u about prefix %s(%u) %d", "Not Notifying Owner: %u about prefix %s(%u) %d vrf: %u",
re->type, prefix2str(p, buff, sizeof(buff)), re->type, prefix2str(p, buff, sizeof(buff)),
re->table, note); re->table, note, re->vrf_id);
} }
return 0; return 0;
} }
@ -673,9 +673,9 @@ int zsend_route_notify_owner(struct route_entry *re, struct prefix *p,
if (IS_ZEBRA_DEBUG_PACKET) { if (IS_ZEBRA_DEBUG_PACKET) {
char buff[PREFIX_STRLEN]; char buff[PREFIX_STRLEN];
zlog_debug("Notifying Owner: %u about prefix %s(%u) %d", zlog_debug("Notifying Owner: %u about prefix %s(%u) %d vrf: %u",
re->type, prefix2str(p, buff, sizeof(buff)), re->type, prefix2str(p, buff, sizeof(buff)),
re->table, note); re->table, note, re->vrf_id);
} }
s = stream_new(ZEBRA_MAX_PACKET_SIZ); s = stream_new(ZEBRA_MAX_PACKET_SIZ);
@ -849,9 +849,10 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
if (IS_ZEBRA_DEBUG_NHT) if (IS_ZEBRA_DEBUG_NHT)
zlog_debug( zlog_debug(
"rnh_register msg from client %s: hdr->length=%d, type=%s\n", "rnh_register msg from client %s: hdr->length=%d, type=%s vrf=%u\n",
zebra_route_string(client->proto), hdr->length, zebra_route_string(client->proto), hdr->length,
(type == RNH_NEXTHOP_TYPE) ? "nexthop" : "route"); (type == RNH_NEXTHOP_TYPE) ? "nexthop" : "route",
zvrf->vrf->vrf_id);
s = msg; s = msg;
@ -924,8 +925,9 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
if (IS_ZEBRA_DEBUG_NHT) if (IS_ZEBRA_DEBUG_NHT)
zlog_debug( zlog_debug(
"rnh_unregister msg from client %s: hdr->length=%d\n", "rnh_unregister msg from client %s: hdr->length=%d vrf: %u\n",
zebra_route_string(client->proto), hdr->length); zebra_route_string(client->proto), hdr->length,
zvrf->vrf->vrf_id);
s = msg; s = msg;
@ -1997,8 +1999,9 @@ static void zread_hello(ZAPI_HANDLER_ARGS)
/* accept only dynamic routing protocols */ /* accept only dynamic routing protocols */
if ((proto < ZEBRA_ROUTE_MAX) && (proto > ZEBRA_ROUTE_STATIC)) { if ((proto < ZEBRA_ROUTE_MAX) && (proto > ZEBRA_ROUTE_STATIC)) {
zlog_notice( zlog_notice(
"client %d says hello and bids fair to announce only %s routes", "client %d says hello and bids fair to announce only %s routes vrf=%u",
client->sock, zebra_route_string(proto)); client->sock, zebra_route_string(proto),
zvrf->vrf->vrf_id);
if (instance) if (instance)
zlog_notice("client protocol instance %d", instance); zlog_notice("client protocol instance %d", instance);
@ -2130,8 +2133,8 @@ static void zread_label_manager_connect(struct zserv *client,
zsend_label_manager_connect_response(client, vrf_id, 1); zsend_label_manager_connect_response(client, vrf_id, 1);
return; return;
} }
zlog_notice("client %d with instance %u connected as %s", client->sock, zlog_notice("client %d with vrf %u instance %u connected as %s",
instance, zebra_route_string(proto)); client->sock, vrf_id, instance, zebra_route_string(proto));
client->proto = proto; client->proto = proto;
client->instance = instance; client->instance = instance;
@ -2142,8 +2145,8 @@ static void zread_label_manager_connect(struct zserv *client,
release_daemon_chunks(proto, instance); release_daemon_chunks(proto, instance);
zlog_debug( zlog_debug(
" Label Manager client connected: sock %d, proto %s, instance %u", " Label Manager client connected: sock %d, proto %s, vrf %u instance %u",
client->sock, zebra_route_string(proto), instance); client->sock, zebra_route_string(proto), vrf_id, instance);
/* send response back */ /* send response back */
zsend_label_manager_connect_response(client, vrf_id, 0); zsend_label_manager_connect_response(client, vrf_id, 0);