mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 03:27:39 +00:00
zebra: Convert srcdest_rnode2str to %pRN in zebra_rib.c
There were a bunch of places where we converted the route node to a prefix string via srcdest_rnode2str when we should have been using %pRN in zebra_rib.c. Just convert over the ones we should to use it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
f0afc61d58
commit
e658173ae6
@ -605,12 +605,9 @@ void rib_install_kernel(struct route_node *rn, struct route_entry *re,
|
|||||||
break;
|
break;
|
||||||
case ZEBRA_DPLANE_REQUEST_FAILURE:
|
case ZEBRA_DPLANE_REQUEST_FAILURE:
|
||||||
{
|
{
|
||||||
char str[SRCDEST2STR_BUFFER];
|
|
||||||
|
|
||||||
srcdest_rnode2str(rn, str, sizeof(str));
|
|
||||||
flog_err(EC_ZEBRA_DP_INSTALL_FAIL,
|
flog_err(EC_ZEBRA_DP_INSTALL_FAIL,
|
||||||
"%u:%u:%s: Failed to enqueue dataplane install",
|
"%u:%u:%pRN: Failed to enqueue dataplane install",
|
||||||
re->vrf_id, re->table, str);
|
re->vrf_id, re->table, rn);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ZEBRA_DPLANE_REQUEST_SUCCESS:
|
case ZEBRA_DPLANE_REQUEST_SUCCESS:
|
||||||
@ -648,15 +645,10 @@ void rib_uninstall_kernel(struct route_node *rn, struct route_entry *re)
|
|||||||
zvrf->removals_queued++;
|
zvrf->removals_queued++;
|
||||||
break;
|
break;
|
||||||
case ZEBRA_DPLANE_REQUEST_FAILURE:
|
case ZEBRA_DPLANE_REQUEST_FAILURE:
|
||||||
{
|
|
||||||
char str[SRCDEST2STR_BUFFER];
|
|
||||||
|
|
||||||
srcdest_rnode2str(rn, str, sizeof(str));
|
|
||||||
flog_err(EC_ZEBRA_DP_INSTALL_FAIL,
|
flog_err(EC_ZEBRA_DP_INSTALL_FAIL,
|
||||||
"%u:%s: Failed to enqueue dataplane uninstall",
|
"%u:%pRN: Failed to enqueue dataplane uninstall",
|
||||||
re->vrf_id, str);
|
re->vrf_id, rn);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case ZEBRA_DPLANE_REQUEST_SUCCESS:
|
case ZEBRA_DPLANE_REQUEST_SUCCESS:
|
||||||
if (zvrf)
|
if (zvrf)
|
||||||
zvrf->removals++;
|
zvrf->removals++;
|
||||||
@ -753,15 +745,12 @@ void zebra_rib_evaluate_rn_nexthops(struct route_node *rn, uint32_t seq)
|
|||||||
* would match a more specific route
|
* would match a more specific route
|
||||||
*/
|
*/
|
||||||
while (rn) {
|
while (rn) {
|
||||||
if (IS_ZEBRA_DEBUG_NHT_DETAILED) {
|
if (IS_ZEBRA_DEBUG_NHT_DETAILED)
|
||||||
char buf[PREFIX_STRLEN];
|
|
||||||
|
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s: %s Being examined for Nexthop Tracking Count: %zd",
|
"%s: %pRN Being examined for Nexthop Tracking Count: %zd",
|
||||||
__func__,
|
__func__, rn,
|
||||||
srcdest_rnode2str(rn, buf, sizeof(buf)),
|
|
||||||
dest ? rnh_list_count(&dest->nht) : 0);
|
dest ? rnh_list_count(&dest->nht) : 0);
|
||||||
}
|
|
||||||
if (!dest) {
|
if (!dest) {
|
||||||
rn = rn->parent;
|
rn = rn->parent;
|
||||||
if (rn)
|
if (rn)
|
||||||
@ -779,17 +768,12 @@ void zebra_rib_evaluate_rn_nexthops(struct route_node *rn, uint32_t seq)
|
|||||||
zebra_vrf_lookup_by_id(rnh->vrf_id);
|
zebra_vrf_lookup_by_id(rnh->vrf_id);
|
||||||
struct prefix *p = &rnh->node->p;
|
struct prefix *p = &rnh->node->p;
|
||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_NHT_DETAILED) {
|
if (IS_ZEBRA_DEBUG_NHT_DETAILED)
|
||||||
char buf1[PREFIX_STRLEN];
|
|
||||||
|
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s(%u):%s has Nexthop(%pFX) Type: %s depending on it, evaluating %u:%u",
|
"%s(%u):%pRN has Nexthop(%pFX) Type: %s depending on it, evaluating %u:%u",
|
||||||
zvrf_name(zvrf), zvrf_id(zvrf),
|
zvrf_name(zvrf), zvrf_id(zvrf),
|
||||||
srcdest_rnode2str(rn, buf1,
|
rn, p, rnh_type2str(rnh->type), seq,
|
||||||
sizeof(buf1)),
|
|
||||||
p, rnh_type2str(rnh->type), seq,
|
|
||||||
rnh->seqno);
|
rnh->seqno);
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we have evaluated this node on this pass
|
* If we have evaluated this node on this pass
|
||||||
@ -890,13 +874,10 @@ static void rib_process_add_fib(struct zebra_vrf *zvrf, struct route_node *rn,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_RIB) {
|
if (IS_ZEBRA_DEBUG_RIB)
|
||||||
char buf[SRCDEST2STR_BUFFER];
|
zlog_debug("%s(%u:%u):%pRN: Adding route rn %p, re %p (%s)",
|
||||||
srcdest_rnode2str(rn, buf, sizeof(buf));
|
zvrf_name(zvrf), zvrf_id(zvrf), new->table, rn, rn,
|
||||||
zlog_debug("%s(%u:%u):%s: Adding route rn %p, re %p (%s)",
|
|
||||||
zvrf_name(zvrf), zvrf_id(zvrf), new->table, buf, rn,
|
|
||||||
new, zebra_route_string(new->type));
|
new, zebra_route_string(new->type));
|
||||||
}
|
|
||||||
|
|
||||||
/* If labeled-unicast route, install transit LSP. */
|
/* If labeled-unicast route, install transit LSP. */
|
||||||
if (zebra_rib_labeled_unicast(new))
|
if (zebra_rib_labeled_unicast(new))
|
||||||
@ -913,13 +894,10 @@ static void rib_process_del_fib(struct zebra_vrf *zvrf, struct route_node *rn,
|
|||||||
hook_call(rib_update, rn, "removing existing route");
|
hook_call(rib_update, rn, "removing existing route");
|
||||||
|
|
||||||
/* Uninstall from kernel. */
|
/* Uninstall from kernel. */
|
||||||
if (IS_ZEBRA_DEBUG_RIB) {
|
if (IS_ZEBRA_DEBUG_RIB)
|
||||||
char buf[SRCDEST2STR_BUFFER];
|
zlog_debug("%s(%u:%u):%pRN: Deleting route rn %p, re %p (%s)",
|
||||||
srcdest_rnode2str(rn, buf, sizeof(buf));
|
zvrf_name(zvrf), zvrf_id(zvrf), old->table, rn, rn,
|
||||||
zlog_debug("%s(%u:%u):%s: Deleting route rn %p, re %p (%s)",
|
|
||||||
zvrf_name(zvrf), zvrf_id(zvrf), old->table, buf, rn,
|
|
||||||
old, zebra_route_string(old->type));
|
old, zebra_route_string(old->type));
|
||||||
}
|
|
||||||
|
|
||||||
/* If labeled-unicast route, uninstall transit LSP. */
|
/* If labeled-unicast route, uninstall transit LSP. */
|
||||||
if (zebra_rib_labeled_unicast(old))
|
if (zebra_rib_labeled_unicast(old))
|
||||||
@ -965,22 +943,19 @@ static void rib_process_update_fib(struct zebra_vrf *zvrf,
|
|||||||
*/
|
*/
|
||||||
if (nh_active) {
|
if (nh_active) {
|
||||||
if (IS_ZEBRA_DEBUG_RIB) {
|
if (IS_ZEBRA_DEBUG_RIB) {
|
||||||
char buf[SRCDEST2STR_BUFFER];
|
|
||||||
|
|
||||||
srcdest_rnode2str(rn, buf, sizeof(buf));
|
|
||||||
if (new != old)
|
if (new != old)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s(%u:%u):%s: Updating route rn %p, re %p (%s) old %p (%s)",
|
"%s(%u:%u):%pRN: Updating route rn %p, re %p (%s) old %p (%s)",
|
||||||
zvrf_name(zvrf), zvrf_id(zvrf),
|
zvrf_name(zvrf), zvrf_id(zvrf),
|
||||||
new->table, buf, rn, new,
|
new->table, rn, rn, new,
|
||||||
zebra_route_string(new->type),
|
zebra_route_string(new->type),
|
||||||
old,
|
old,
|
||||||
zebra_route_string(old->type));
|
zebra_route_string(old->type));
|
||||||
else
|
else
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s(%u:%u):%s: Updating route rn %p, re %p (%s)",
|
"%s(%u:%u):%pRN: Updating route rn %p, re %p (%s)",
|
||||||
zvrf_name(zvrf), zvrf_id(zvrf),
|
zvrf_name(zvrf), zvrf_id(zvrf),
|
||||||
new->table, buf, rn, new,
|
new->table, rn, rn, new,
|
||||||
zebra_route_string(new->type));
|
zebra_route_string(new->type));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1006,21 +981,19 @@ static void rib_process_update_fib(struct zebra_vrf *zvrf,
|
|||||||
*/
|
*/
|
||||||
if (!nh_active) {
|
if (!nh_active) {
|
||||||
if (IS_ZEBRA_DEBUG_RIB) {
|
if (IS_ZEBRA_DEBUG_RIB) {
|
||||||
char buf[SRCDEST2STR_BUFFER];
|
|
||||||
srcdest_rnode2str(rn, buf, sizeof(buf));
|
|
||||||
if (new != old)
|
if (new != old)
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s(%u:%u):%s: Deleting route rn %p, re %p (%s) old %p (%s) - nexthop inactive",
|
"%s(%u:%u):%pRN: Deleting route rn %p, re %p (%s) old %p (%s) - nexthop inactive",
|
||||||
zvrf_name(zvrf), zvrf_id(zvrf),
|
zvrf_name(zvrf), zvrf_id(zvrf),
|
||||||
new->table, buf, rn, new,
|
new->table, rn, rn, new,
|
||||||
zebra_route_string(new->type),
|
zebra_route_string(new->type),
|
||||||
old,
|
old,
|
||||||
zebra_route_string(old->type));
|
zebra_route_string(old->type));
|
||||||
else
|
else
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s(%u:%u):%s: Deleting route rn %p, re %p (%s) - nexthop inactive",
|
"%s(%u:%u):%pRN: Deleting route rn %p, re %p (%s) - nexthop inactive",
|
||||||
zvrf_name(zvrf), zvrf_id(zvrf),
|
zvrf_name(zvrf), zvrf_id(zvrf),
|
||||||
new->table, buf, rn, new,
|
new->table, rn, rn, new,
|
||||||
zebra_route_string(new->type));
|
zebra_route_string(new->type));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1137,7 +1110,6 @@ static void rib_process(struct route_node *rn)
|
|||||||
struct route_entry *old_fib = NULL;
|
struct route_entry *old_fib = NULL;
|
||||||
struct route_entry *new_fib = NULL;
|
struct route_entry *new_fib = NULL;
|
||||||
struct route_entry *best = NULL;
|
struct route_entry *best = NULL;
|
||||||
char buf[SRCDEST2STR_BUFFER];
|
|
||||||
rib_dest_t *dest;
|
rib_dest_t *dest;
|
||||||
struct zebra_vrf *zvrf = NULL;
|
struct zebra_vrf *zvrf = NULL;
|
||||||
struct vrf *vrf;
|
struct vrf *vrf;
|
||||||
@ -1161,9 +1133,6 @@ static void rib_process(struct route_node *rn)
|
|||||||
|
|
||||||
vrf = vrf_lookup_by_id(vrf_id);
|
vrf = vrf_lookup_by_id(vrf_id);
|
||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_RIB)
|
|
||||||
srcdest_rnode2str(rn, buf, sizeof(buf));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* we can have rn's that have a NULL info pointer
|
* we can have rn's that have a NULL info pointer
|
||||||
* (dest). As such let's not let the deref happen
|
* (dest). As such let's not let the deref happen
|
||||||
@ -1173,8 +1142,8 @@ static void rib_process(struct route_node *rn)
|
|||||||
if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
|
if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
|
||||||
struct route_entry *re = re_list_first(&dest->routes);
|
struct route_entry *re = re_list_first(&dest->routes);
|
||||||
|
|
||||||
zlog_debug("%s(%u:%u):%s: Processing rn %p",
|
zlog_debug("%s(%u:%u):%pRN: Processing rn %p",
|
||||||
VRF_LOGNAME(vrf), vrf_id, re->table, buf,
|
VRF_LOGNAME(vrf), vrf_id, re->table, rn,
|
||||||
rn);
|
rn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1186,8 +1155,8 @@ static void rib_process(struct route_node *rn)
|
|||||||
char status_buf[128];
|
char status_buf[128];
|
||||||
|
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s(%u:%u):%s: Examine re %p (%s) status: %sflags: %sdist %d metric %d",
|
"%s(%u:%u):%pRN: Examine re %p (%s) status: %sflags: %sdist %d metric %d",
|
||||||
VRF_LOGNAME(vrf), vrf_id, re->table, buf, re,
|
VRF_LOGNAME(vrf), vrf_id, re->table, rn, re,
|
||||||
zebra_route_string(re->type),
|
zebra_route_string(re->type),
|
||||||
_dump_re_status(re, status_buf,
|
_dump_re_status(re, status_buf,
|
||||||
sizeof(status_buf)),
|
sizeof(status_buf)),
|
||||||
@ -1237,11 +1206,11 @@ 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(%u):%s: imported via import-table but denied by the ip protocol table route-map",
|
"%s: %s(%u):%pRN: imported via import-table but denied by the ip protocol table route-map",
|
||||||
__func__,
|
__func__,
|
||||||
VRF_LOGNAME(
|
VRF_LOGNAME(
|
||||||
vrf),
|
vrf),
|
||||||
vrf_id, buf);
|
vrf_id, rn);
|
||||||
rib_unlink(rn, re);
|
rib_unlink(rn, re);
|
||||||
} else
|
} else
|
||||||
SET_FLAG(re->status,
|
SET_FLAG(re->status,
|
||||||
@ -1316,8 +1285,8 @@ static void rib_process(struct route_node *rn)
|
|||||||
: new_fib ? new_fib : NULL;
|
: new_fib ? new_fib : NULL;
|
||||||
|
|
||||||
zlog_debug(
|
zlog_debug(
|
||||||
"%s(%u:%u):%s: After processing: old_selected %p new_selected %p old_fib %p new_fib %p",
|
"%s(%u:%u):%pRN: After processing: old_selected %p new_selected %p old_fib %p new_fib %p",
|
||||||
VRF_LOGNAME(vrf), vrf_id, entry ? entry->table : 0, buf,
|
VRF_LOGNAME(vrf), vrf_id, entry ? entry->table : 0, rn,
|
||||||
(void *)old_selected, (void *)new_selected,
|
(void *)old_selected, (void *)new_selected,
|
||||||
(void *)old_fib, (void *)new_fib);
|
(void *)old_fib, (void *)new_fib);
|
||||||
}
|
}
|
||||||
@ -2472,7 +2441,6 @@ static void process_subq_route(struct listnode *lnode, uint8_t qindex)
|
|||||||
|
|
||||||
if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
|
if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
|
||||||
struct route_entry *re = NULL;
|
struct route_entry *re = NULL;
|
||||||
char buf[SRCDEST2STR_BUFFER];
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* rib_process may have freed the dest
|
* rib_process may have freed the dest
|
||||||
@ -2483,10 +2451,9 @@ static void process_subq_route(struct listnode *lnode, uint8_t qindex)
|
|||||||
if (dest)
|
if (dest)
|
||||||
re = re_list_first(&dest->routes);
|
re = re_list_first(&dest->routes);
|
||||||
|
|
||||||
srcdest_rnode2str(rnode, buf, sizeof(buf));
|
zlog_debug("%s(%u:%u):%pRN rn %p dequeued from sub-queue %u",
|
||||||
zlog_debug("%s(%u:%u):%s: rn %p dequeued from sub-queue %u",
|
|
||||||
zvrf_name(zvrf), zvrf_id(zvrf), re ? re->table : 0,
|
zvrf_name(zvrf), zvrf_id(zvrf), re ? re->table : 0,
|
||||||
buf, rnode, qindex);
|
rnode, rnode, qindex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rnode->info)
|
if (rnode->info)
|
||||||
@ -3193,13 +3160,10 @@ void rib_delnode(struct route_node *rn, struct route_entry *re)
|
|||||||
|
|
||||||
zebra_del_import_table_entry(zvrf, rn, re);
|
zebra_del_import_table_entry(zvrf, rn, re);
|
||||||
/* Just clean up if non main table */
|
/* Just clean up if non main table */
|
||||||
if (IS_ZEBRA_DEBUG_RIB) {
|
if (IS_ZEBRA_DEBUG_RIB)
|
||||||
char buf[SRCDEST2STR_BUFFER];
|
zlog_debug("%s(%u):%pRN: Freeing route rn %p, re %p (%s)",
|
||||||
srcdest_rnode2str(rn, buf, sizeof(buf));
|
vrf_id_to_name(re->vrf_id), re->vrf_id, rn,
|
||||||
zlog_debug("%s(%u):%s: Freeing route rn %p, re %p (%s)",
|
|
||||||
vrf_id_to_name(re->vrf_id), re->vrf_id, buf,
|
|
||||||
rn, re, zebra_route_string(re->type));
|
rn, re, zebra_route_string(re->type));
|
||||||
}
|
|
||||||
|
|
||||||
rib_unlink(rn, re);
|
rib_unlink(rn, re);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user