zebra: Cleanup indentation in function

Indentation was deep and hard to understand in
zebra_gr_delete_stale_route

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2023-03-24 14:21:43 -04:00
parent 310ee91718
commit 559dbc2ea1

View File

@ -556,55 +556,55 @@ static int32_t zebra_gr_delete_stale_route(struct client_gr_info *info,
for (afi = curr_afi; afi < AFI_MAX; afi++) { for (afi = curr_afi; afi < AFI_MAX; afi++) {
table = zvrf->table[afi][SAFI_UNICAST]; table = zvrf->table[afi][SAFI_UNICAST];
if (table) { if (!table)
/* continue;
* If the current prefix is NULL then get the first
* route entry in the table /*
*/ * If the current prefix is NULL then get the first
if (info->current_prefix == NULL) { * route entry in the table
rn = route_top(table); */
if (rn == NULL) if (info->current_prefix == NULL) {
rn = route_top(table);
if (rn == NULL)
continue;
curr = rn;
} else
/* Get the next route entry */
curr = route_table_get_next(table,
info->current_prefix);
for (rn = curr; rn; rn = srcdest_route_next(rn)) {
RNODE_FOREACH_RE_SAFE (rn, re, next) {
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
continue; continue;
curr = rn; /* If the route refresh is received
} else * after restart then do not delete
/* Get the next route entry */ * the route
curr = route_table_get_next( */
table, info->current_prefix); if (re->type == proto &&
re->instance == instance) {
zebra_gr_process_route_entry(s_client,
rn, re);
n++;
}
for (rn = curr; rn; rn = srcdest_route_next(rn)) { /* If the max route count is reached
RNODE_FOREACH_RE_SAFE (rn, re, next) { * then timer thread will be restarted
if (CHECK_FLAG(re->status, * Store the current prefix and afi
ROUTE_ENTRY_REMOVED)) */
continue; if ((n >= ZEBRA_MAX_STALE_ROUTE_COUNT) &&
/* If the route refresh is received (info->do_delete == false)) {
* after restart then do not delete info->current_afi = afi;
* the route info->current_prefix =
*/ XCALLOC(MTYPE_ZEBRA_GR,
if (re->type == proto
&& re->instance == instance) {
zebra_gr_process_route_entry(
s_client, rn, re);
n++;
}
/* If the max route count is reached
* then timer thread will be restarted
* Store the current prefix and afi
*/
if ((n >= ZEBRA_MAX_STALE_ROUTE_COUNT)
&& (info->do_delete == false)) {
info->current_afi = afi;
info->current_prefix = XCALLOC(
MTYPE_ZEBRA_GR,
sizeof(struct prefix)); sizeof(struct prefix));
prefix_copy( prefix_copy(info->current_prefix,
info->current_prefix, &rn->p);
&rn->p); return n;
return n;
}
} }
} }
} }
/* /*
* Reset the current prefix to indicate processing completion * Reset the current prefix to indicate processing completion
* of the current AFI * of the current AFI