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:
@ -258,8 +258,12 @@ class addressvirtual(moduleBase):
|
|||||||
|
|
||||||
# If link existed before, flap the link
|
# If link existed before, flap the link
|
||||||
if not link_created:
|
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:
|
if update_mtu:
|
||||||
lower_iface_mtu = self.ipcmd.link_get_mtu(ifaceobj.name, refresh=True)
|
lower_iface_mtu = self.ipcmd.link_get_mtu(ifaceobj.name, refresh=True)
|
||||||
update_mtu = False
|
update_mtu = False
|
||||||
|
Reference in New Issue
Block a user