Skip to content

Commit

Permalink
zebra: fix crash upon route update using nexthop group
Browse files Browse the repository at this point in the history
The following crash happens when BGP attempts to install a route
with a nexthop group group type.

> FRRouting#6  0x00005641fa043607 in dplane_route_update_internal (rn=0x5641fb5ab460, re=0x5641fb0a3c50, old_re=0x5641fb5ab180,
> FRRouting#7  0x00005641fa043b79 in dplane_route_update (rn=0x5641fb5ab460, re=0x5641fb0a3c50, old_re=0x5641fb5ab180) at zebra/zebra_dplane.c:4549
> FRRouting#8  0x00005641fa08b289 in rib_install_kernel (rn=0x5641fb5ab460, re=0x5641fb0a3c50, old=0x5641fb5ab180) at zebra/zebra_rib.c:737
> FRRouting#9  0x00005641fa08bf46 in rib_process_update_fib (zvrf=0x5641faf96820, rn=0x5641fb5ab460, old=0x5641fb5ab180, new=0x5641fb0a3c50)
> FRRouting#10 0x00005641fa08cd48 in rib_process (rn=0x5641fb5ab460) at zebra/zebra_rib.c:1492
> FRRouting#11 0x00005641fa08f9b2 in process_subq_route (lnode=0x5641fb5b5cd0, qindex=8 '\b') at zebra/zebra_rib.c:2666
> FRRouting#12 0x00005641fa0912b2 in process_subq (subq=0x5641faf5ad80, qindex=META_QUEUE_BGP) at zebra/zebra_rib.c:3269
> FRRouting#13 0x00005641fa09139a in meta_queue_process (dummy=0x5641faf5abe0, data=0x5641faf5ac80) at zebra/zebra_rib.c:3308
> FRRouting#14 0x00007f8300599368 in work_queue_run (thread=0x7ffd420c9410) at lib/workqueue.c:282

No need to update the nexthop and consider the route as installed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
  • Loading branch information
pguibert6WIND committed Feb 27, 2024
1 parent f60444b commit 5ce6a95
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions zebra/zebra_dplane.c
Original file line number Diff line number Diff line change
Expand Up @@ -4307,16 +4307,19 @@ dplane_route_update_internal(struct route_node *rn,
"%s: Ignoring Route exactly the same",
__func__);

for (ALL_NEXTHOPS_PTR(dplane_ctx_get_ng(ctx),
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);
if (!CHECK_FLAG(dplane_ctx_get_ng(ctx)->flags,
NEXTHOP_GROUP_TYPE_GROUP)) {
for (ALL_NEXTHOPS_PTR(dplane_ctx_get_ng(ctx),
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);
}
}

if ((op == DPLANE_OP_ROUTE_UPDATE) && old_re && re &&
Expand Down

0 comments on commit 5ce6a95

Please sign in to comment.