diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c index aba1a1bb..0a0c06d6 100644 --- a/lib/route/route_obj.c +++ b/lib/route/route_obj.c @@ -449,7 +449,7 @@ static uint64_t route_compare(struct nl_object *_a, struct nl_object *_b, found = 0; nl_list_for_each_entry(nh_b, &b->rt_nexthops, rtnh_list) { - if (!rtnl_route_nh_compare(nh_a, nh_b, ~0, 0)) { + if (rtnl_route_nh_identical(nh_a, nh_b)) { found = 1; break; } @@ -464,7 +464,7 @@ static uint64_t route_compare(struct nl_object *_a, struct nl_object *_b, found = 0; nl_list_for_each_entry(nh_a, &a->rt_nexthops, rtnh_list) { - if (!rtnl_route_nh_compare(nh_a, nh_b, ~0, 0)) { + if (rtnl_route_nh_identical(nh_a, nh_b)) { found = 1; break; } @@ -538,7 +538,7 @@ static int route_update(struct nl_object *old_obj, struct nl_object *new_obj) * 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)) { + if (rtnl_route_nh_identical(old_nh, new_nh)) { return 0; } } @@ -574,15 +574,7 @@ 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) { - /* - * Since the new route has only one nexthop, it's not - * an ECMP route and the nexthop won't have a weight. - * Similarily, the nexthop might have been marked as - * DEAD in its flags if it was deleted. - * Therefore ignore NH_ATTR_FLAGS (= 0x1) and - * NH_ATTR_WEIGHT (= 0x2) while comparing nexthops. - */ - if (!rtnl_route_nh_compare(old_nh, new_nh, ~0x3, 0)) { + if (rtnl_route_nh_identical(old_nh, new_nh)) { rtnl_route_remove_nexthop(old_route, old_nh);