Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pbrd extra #2051

Merged
merged 14 commits into from
Apr 20, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lib: Clean up delete of a nexthop from a nexthop group
The delete was not properly deleting the nexthop from
the nexthop group and it was not properly setting the
nexthop's pointers to NULL.

Ticket: CM-20261
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
  • Loading branch information
donaldsharp committed Apr 17, 2018
commit ebee2bc4c5e948f4b6525e0b767679b7b62b7a2f
4 changes: 4 additions & 0 deletions lib/nexthop_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ void nexthop_del(struct nexthop_group *nhg, struct nexthop *nh)

if (nexthop->next)
nexthop->next->prev = nexthop->prev;

nh->prev = NULL;
nh->next = NULL;
}

void copy_nexthops(struct nexthop **tnh, struct nexthop *nh,
Expand Down Expand Up @@ -151,6 +154,7 @@ static void nhgc_delete_nexthops(struct nexthop_group_cmd *nhgc)
while (nexthop) {
struct nexthop *next = nexthop_next(nexthop);

nexthop_del(&nhgc->nhg, nexthop);
if (nhg_hooks.del_nexthop)
nhg_hooks.del_nexthop(nhgc, nexthop);

Expand Down