Skip to content

Commit

Permalink
pbrd: fix problem removing nonexistent nexthop
Browse files Browse the repository at this point in the history
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
  • Loading branch information
dslicenc authored and donaldsharp committed Feb 21, 2018
1 parent fbe26fe commit a7f139a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/nexthop_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,14 @@ DEFPY(ecmp_nexthops,

nh = nexthop_exists(&nhgc->nhg, &nhop);

if (no && nh) {
nexthop_del(&nhgc->nhg, nh);
nexthop_free(nh);
if (no) {
if (nh) {
nexthop_del(&nhgc->nhg, nh);
nexthop_free(nh);

if (nhg_hooks.del_nexthop)
nhg_hooks.del_nexthop(nhgc->name);
if (nhg_hooks.del_nexthop)
nhg_hooks.del_nexthop(nhgc->name);
}
} else if (!nh) {
/* must be adding new nexthop since !no and !nexthop_exists */
nh = nexthop_new();
Expand Down

0 comments on commit a7f139a

Please sign in to comment.