mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 23:58:44 +00:00
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:
parent
310ee91718
commit
559dbc2ea1
@ -556,7 +556,9 @@ 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
|
* If the current prefix is NULL then get the first
|
||||||
* route entry in the table
|
* route entry in the table
|
||||||
@ -568,22 +570,21 @@ static int32_t zebra_gr_delete_stale_route(struct client_gr_info *info,
|
|||||||
curr = rn;
|
curr = rn;
|
||||||
} else
|
} else
|
||||||
/* Get the next route entry */
|
/* Get the next route entry */
|
||||||
curr = route_table_get_next(
|
curr = route_table_get_next(table,
|
||||||
table, info->current_prefix);
|
info->current_prefix);
|
||||||
|
|
||||||
for (rn = curr; rn; rn = srcdest_route_next(rn)) {
|
for (rn = curr; rn; rn = srcdest_route_next(rn)) {
|
||||||
RNODE_FOREACH_RE_SAFE (rn, re, next) {
|
RNODE_FOREACH_RE_SAFE (rn, re, next) {
|
||||||
if (CHECK_FLAG(re->status,
|
if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED))
|
||||||
ROUTE_ENTRY_REMOVED))
|
|
||||||
continue;
|
continue;
|
||||||
/* If the route refresh is received
|
/* If the route refresh is received
|
||||||
* after restart then do not delete
|
* after restart then do not delete
|
||||||
* the route
|
* the route
|
||||||
*/
|
*/
|
||||||
if (re->type == proto
|
if (re->type == proto &&
|
||||||
&& re->instance == instance) {
|
re->instance == instance) {
|
||||||
zebra_gr_process_route_entry(
|
zebra_gr_process_route_entry(s_client,
|
||||||
s_client, rn, re);
|
rn, re);
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -591,20 +592,19 @@ static int32_t zebra_gr_delete_stale_route(struct client_gr_info *info,
|
|||||||
* then timer thread will be restarted
|
* then timer thread will be restarted
|
||||||
* Store the current prefix and afi
|
* Store the current prefix and afi
|
||||||
*/
|
*/
|
||||||
if ((n >= ZEBRA_MAX_STALE_ROUTE_COUNT)
|
if ((n >= ZEBRA_MAX_STALE_ROUTE_COUNT) &&
|
||||||
&& (info->do_delete == false)) {
|
(info->do_delete == false)) {
|
||||||
info->current_afi = afi;
|
info->current_afi = afi;
|
||||||
info->current_prefix = XCALLOC(
|
info->current_prefix =
|
||||||
MTYPE_ZEBRA_GR,
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user