1
0
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:
Roopa Prabhu
2016-09-14 11:19:57 -07:00
parent 82908a2d73
commit dc3f4c4507
2 changed files with 12 additions and 1 deletions

View File

@@ -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)

View File

@@ -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)))