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: fix duplicate nexthop entries under nexthop-group #12

Merged
merged 1 commit into from
Feb 21, 2018
Merged
Changes from all commits
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
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