route: Remove leftover single hop route

Gris Ge requested to merge cathay4t/NetworkManager:fix_ecmp into main

When merging existing single hop route to desired ECMP route, NetworkManager forgot to remove the pre-exist single hop route.

For example, when two profiles both defined ECMP route, we got: via dev dummy1 proto static metric 150   <--- proto static metric 150
    nexthop via dev dummy1 weight 2
    nexthop via dev dummy2 weight 25

In previous code, we only delete left over route when the left over route is a ECMP(n_nexthops >1), to fix the problem, when merged new ECMP route has multiple next hops, we should remove the left over route.


Edited by Gris Ge

Merge request reports