diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c index 8448e9a8..697dca0c 100644 --- a/lib/route/route_obj.c +++ b/lib/route/route_obj.c @@ -528,6 +528,13 @@ static int route_update(struct nl_object *old_obj, struct nl_object *new_obj) if (rtnl_route_get_nnexthops(new_route) != 1) return -NLE_OPNOTSUPP; + /* + * If the route's nexthop id has changed, the new route replaces the + * old one + */ + if (rtnl_route_get_nhid(old_route) != rtnl_route_get_nhid(new_route)) + return -NLE_OPNOTSUPP; + /* * Get the only nexthop entry from the new route. For * IPv6 we always get a route with a 0th NH