mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
addons: addressvirtual: fix handling of admin state of macvlan interfaces
Ticket: CM-12823 Reviewed By: julien, nikhil Testing Done: Tested addressvirtual config with vrfs (as described in the bug) Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This commit is contained in:
@@ -201,6 +201,12 @@ class addressvirtual(moduleBase):
|
||||
if lower_iface_mtu and lower_iface_mtu != self.ipcmd.link_get_mtu(macvlan_ifacename):
|
||||
self.ipcmd.link_set_mtu(macvlan_ifacename, lower_iface_mtu)
|
||||
|
||||
# set macvlan device to up in anycase.
|
||||
# since we auto create them here..we are responsible
|
||||
# to bring them up here in the case they were brought down
|
||||
# by some other entity in the system.
|
||||
netlink.link_set_updown(macvlan_ifacename, "up")
|
||||
|
||||
# handle vrf slaves
|
||||
if (ifaceobj.link_privflags & ifaceLinkPrivFlags.VRF_SLAVE):
|
||||
self._handle_vrf_slaves(macvlan_ifacename, ifaceobj)
|
||||
|
@@ -858,7 +858,12 @@ class vrf(moduleBase):
|
||||
try:
|
||||
self._handle_existing_connections(ifaceobj, vrfname)
|
||||
self.ipcmd.link_set(ifacename, 'nomaster')
|
||||
netlink.link_set_updown(ifacename, "down")
|
||||
# Down this slave only if it is a slave ifupdown2 manages.
|
||||
# we dont want to down slaves that maybe up'ed by
|
||||
# somebody else. One such example is a macvlan device
|
||||
# which ifupdown2 addressvirtual addon module auto creates
|
||||
if ifaceobj:
|
||||
netlink.link_set_updown(ifacename, "down")
|
||||
except Exception, e:
|
||||
self.logger.warn('%s: %s' %(ifacename, str(e)))
|
||||
|
||||
|
Reference in New Issue
Block a user