Skip to content

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:

198.51.100.0/24 via 192.0.2.1 dev dummy1 proto static metric 150   <---
198.51.100.0/24 proto static metric 150
    nexthop via 192.0.2.1 dev dummy1 weight 2
    nexthop via 192.0.2.2 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.

Reference: https://issues.redhat.com/browse/RHEL-1682

Edited by Gris Ge

Merge request reports