diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-03-28 19:31:40 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-17 18:40:17 -0400 |
| commit | ebee2bc4c5e948f4b6525e0b767679b7b62b7a2f (patch) | |
| tree | 94cb77d25150932674aac7c0250d14d38e861b51 | |
| parent | cafec8da4f0a7ac850eb42a71c6d695e1f79fc7c (diff) | |
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>
| -rw-r--r-- | lib/nexthop_group.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/nexthop_group.c b/lib/nexthop_group.c index a527d011ae..b991ed0949 100644 --- a/lib/nexthop_group.c +++ b/lib/nexthop_group.c @@ -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, @@ -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); |
