Now that some system support ip addr METRIC sets we dont have to do this
"fix_connected_route" hack. The hack was previously introduced to make
sure the primary address was the first in the routing table. Some events
could cause some issues like having the macvlan address first in the
routing table. In that case the macvlan needs to be flapped. This shouldn't
happen when we are able to set the address metric
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
# If link existed before, flap the link
if not link_created:
- self._fix_connected_route(ifaceobj, macvlan_ifacename,
- ips[0])
+
+ if not self.ipcmd.addr_metric_support():
+ # if the system doesn't support ip addr set METRIC
+ # we need to do manually check the ordering of the ip4 routes
+ self._fix_connected_route(ifaceobj, macvlan_ifacename, ips[0])
+
if update_mtu:
lower_iface_mtu = self.ipcmd.link_get_mtu(ifaceobj.name, refresh=True)
update_mtu = False