Skip to content

Commit

Permalink
zebra: Add safi to some debugs
Browse files Browse the repository at this point in the history
Trying to figure out what safi we are talking about is fun when
it is not put into the debugs.

Signed-off-by: Donald Sharp <[email protected]>
(cherry picked from commit 811168e)
  • Loading branch information
donaldsharp authored and mergify[bot] committed Oct 28, 2024
1 parent dff3934 commit 1a1dcb6
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions zebra/zebra_rib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1204,8 +1204,15 @@ static void rib_process(struct route_node *rn)
struct zebra_vrf *zvrf = NULL;
struct vrf *vrf;
struct route_entry *proto_re_changed = NULL;

vrf_id_t vrf_id = VRF_UNKNOWN;
safi_t safi = SAFI_UNICAST;

if (IS_ZEBRA_DEBUG_RIB || IS_ZEBRA_DEBUG_RIB_DETAILED) {
struct rib_table_info *info = srcdest_rnode_table_info(rn);

assert(info);
safi = info->safi;
}

assert(rn);

Expand All @@ -1231,9 +1238,8 @@ static void rib_process(struct route_node *rn)
if (IS_ZEBRA_DEBUG_RIB_DETAILED) {
struct route_entry *re = re_list_first(&dest->routes);

zlog_debug("%s(%u:%u):%pRN: Processing rn %p",
VRF_LOGNAME(vrf), vrf_id, re->table, rn,
rn);
zlog_debug("%s(%u:%u:%u):%pRN: Processing rn %p", VRF_LOGNAME(vrf), vrf_id,
re->table, safi, rn, rn);
}

old_fib = dest->selected_fib;
Expand All @@ -1243,15 +1249,12 @@ static void rib_process(struct route_node *rn)
char flags_buf[128];
char status_buf[128];

zlog_debug(
"%s(%u:%u):%pRN: Examine re %p (%s) status: %sflags: %sdist %d metric %d",
VRF_LOGNAME(vrf), vrf_id, re->table, rn, re,
zebra_route_string(re->type),
_dump_re_status(re, status_buf,
sizeof(status_buf)),
zclient_dump_route_flags(re->flags, flags_buf,
sizeof(flags_buf)),
re->distance, re->metric);
zlog_debug("%s(%u:%u:%u):%pRN: Examine re %p (%s) status: %sflags: %sdist %d metric %d",
VRF_LOGNAME(vrf), vrf_id, re->table, safi, rn, re,
zebra_route_string(re->type),
_dump_re_status(re, status_buf, sizeof(status_buf)),
zclient_dump_route_flags(re->flags, flags_buf, sizeof(flags_buf)),
re->distance, re->metric);
}

/* Currently selected re. */
Expand Down Expand Up @@ -1377,11 +1380,10 @@ static void rib_process(struct route_node *rn)
: old_fib ? old_fib
: new_fib ? new_fib : NULL;

zlog_debug(
"%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, rn,
(void *)old_selected, (void *)new_selected,
(void *)old_fib, (void *)new_fib);
zlog_debug("%s(%u:%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, safi, rn,
(void *)old_selected, (void *)new_selected, (void *)old_fib,
(void *)new_fib);
}

/* Buffer ROUTE_ENTRY_CHANGED here, because it will get cleared if
Expand Down

0 comments on commit 1a1dcb6

Please sign in to comment.