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

route: check if nh exists while updating route #290

Closed
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
9 changes: 9 additions & 0 deletions lib/route/route_obj.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,16 @@ static int route_update(struct nl_object *old_obj, struct nl_object *new_obj)
switch(action) {
case RTM_NEWROUTE : {
struct rtnl_nexthop *cloned_nh;
struct rtnl_nexthop *old_nh;

/*
* Do not add the nexthop to old route if it was already added before
*/
nl_list_for_each_entry(old_nh, &old_route->rt_nexthops, rtnh_list) {
if (!rtnl_route_nh_compare(old_nh, new_nh, ~0, 0)) {
return -NLE_OPNOTSUPP;
}
}
/*
* Add the nexthop to old route
*/
Expand Down