Skip to content

Commit

Permalink
zebra: handle fib flag on nexthop updates
Browse files Browse the repository at this point in the history
Sometimes, the NEXTHOP_FLAG_FIB flag of nexthop groups is not
set. This results in some topotests failures.

If the nexthop group is installed, update the NEXTHOP_FLAG_FIB
of every valid nexthop.

Signed-off-by: Philippe Guibert <[email protected]>
  • Loading branch information
pguibert6WIND committed May 31, 2024
1 parent 4c0f68e commit 29ce92f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions zebra/zebra_nhg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3152,6 +3152,7 @@ void zebra_nhg_dplane_result(struct zebra_dplane_ctx *ctx)
enum zebra_dplane_result status;
uint32_t id = 0;
struct nhg_hash_entry *nhe = NULL;
struct nexthop *nexthop;

op = dplane_ctx_get_op(ctx);
status = dplane_ctx_get_status(ctx);
Expand Down Expand Up @@ -3187,6 +3188,21 @@ void zebra_nhg_dplane_result(struct zebra_dplane_ctx *ctx)
switch (status) {
case ZEBRA_DPLANE_REQUEST_SUCCESS:
SET_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED);
/* Update installed nexthops to signal which have been
* installed.
*/
for (ALL_NEXTHOPS_PTR(&nhe->nhg, nexthop)) {
if (CHECK_FLAG(nexthop->flags,
NEXTHOP_FLAG_RECURSIVE))
continue;

if (CHECK_FLAG(nexthop->flags,
NEXTHOP_FLAG_ACTIVE)) {
SET_FLAG(nexthop->flags,
NEXTHOP_FLAG_FIB);
}
}

zebra_nhg_handle_install(nhe, true);

/* If daemon nhg, send it an update */
Expand Down

0 comments on commit 29ce92f

Please sign in to comment.