Skip to content

Commit

Permalink
pbrd: fix duplicate nexthop entries under nexthop-group
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 308ed8e commit fbe26fe
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions lib/nexthop_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,17 +261,15 @@ DEFPY(ecmp_nexthops,
nhop.type = NEXTHOP_TYPE_IPV6;
}

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

if (nhg_hooks.del_nexthop)
nhg_hooks.del_nexthop(nhgc->name);
}
}
else {
nh = nexthop_exists(&nhgc->nhg, &nhop);

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

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 fbe26fe

Please sign in to comment.