mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-17 20:09:38 +00:00
zebra: set nexthop install state more accurately
When setting route nexthops' installation state based on a dataplane context struct, unset the installed state if a nexthop was not present in the dataplane context. Signed-off-by: Mark Stapp <mjs@voltanet.io>
This commit is contained in:
parent
fad4d69cd4
commit
5695d9ac5d
@ -1858,31 +1858,30 @@ static int rib_update_re_from_ctx(struct route_entry *re,
|
|||||||
/* Update zebra nexthop FIB flag for each
|
/* Update zebra nexthop FIB flag for each
|
||||||
* nexthop that was installed.
|
* nexthop that was installed.
|
||||||
*/
|
*/
|
||||||
for (ALL_NEXTHOPS_PTR(dplane_ctx_get_ng(ctx),
|
for (ALL_NEXTHOPS(re->ng, nexthop)) {
|
||||||
ctx_nexthop)) {
|
|
||||||
|
|
||||||
if (!re)
|
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (ALL_NEXTHOPS(re->ng, nexthop)) {
|
for (ALL_NEXTHOPS_PTR(dplane_ctx_get_ng(ctx),
|
||||||
|
ctx_nexthop)) {
|
||||||
|
|
||||||
if (nexthop_same(ctx_nexthop, nexthop))
|
if (nexthop_same(ctx_nexthop, nexthop))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nexthop == NULL)
|
/* If the FIB doesn't know about the nexthop,
|
||||||
|
* it's not installed
|
||||||
|
*/
|
||||||
|
if (ctx_nexthop == NULL) {
|
||||||
|
UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (CHECK_FLAG(nexthop->flags,
|
if (CHECK_FLAG(ctx_nexthop->flags, NEXTHOP_FLAG_FIB))
|
||||||
NEXTHOP_FLAG_RECURSIVE))
|
SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
|
||||||
continue;
|
|
||||||
|
|
||||||
if (CHECK_FLAG(ctx_nexthop->flags,
|
|
||||||
NEXTHOP_FLAG_FIB))
|
|
||||||
SET_FLAG(nexthop->flags,
|
|
||||||
NEXTHOP_FLAG_FIB);
|
|
||||||
else
|
else
|
||||||
UNSET_FLAG(nexthop->flags,
|
UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
|
||||||
NEXTHOP_FLAG_FIB);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Redistribute */
|
/* Redistribute */
|
||||||
|
Loading…
Reference in New Issue
Block a user