summaryrefslogtreecommitdiffstats
path: root/lib/route
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-03-04 09:53:41 (GMT)
committerThomas Haller <thaller@redhat.com>2022-03-04 09:53:41 (GMT)
commit28a652b0398950ccf0e63f0260094fd527aa8125 (patch)
tree3b8d1c1fdf716276cd0e4b2d600764126f7901df /lib/route
parent03bfd2fec97f4ebbadab32f0bb26db6d8c33b51c (diff)
downloadlibnl-28a652b0398950ccf0e63f0260094fd527aa8125.zip
libnl-28a652b0398950ccf0e63f0260094fd527aa8125.tar.gz
libnl-28a652b0398950ccf0e63f0260094fd527aa8125.tar.bz2
route: fix duplicate check for next hop for IPv6 multipath routes
The check is right, that we skip adding the next hop if it already exists. However, we must not return a failure. Instead, we need to return success, that the old object is already good.
Diffstat (limited to 'lib/route')
-rw-r--r--lib/route/route_obj.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c
index cd58b85..e965e51 100644
--- a/lib/route/route_obj.c
+++ b/lib/route/route_obj.c
@@ -507,9 +507,10 @@ static int route_update(struct nl_object *old_obj, struct nl_object *new_obj)
*/
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;
+ return 0;
}
}
+
/*
* Add the nexthop to old route
*/