1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

addons: addressvirtual: if system supports addr METRIC set skip route hack

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>
This commit is contained in:
Julien Fortin
2018-06-18 19:24:12 +02:00
parent 7b711dc521
commit 20e547e795

View File

@ -258,8 +258,12 @@ class addressvirtual(moduleBase):
# 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