mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
This patch moves bond slave link ownership to the bond module and makes
sure that slaves can never be brought admin up on their own when they are not in the bond Ticket: CM-4408 Reviewed By: CCR-2323 Testing Done: Tested ifup/ifdown of bond slaves and bond interface This patch introduces: - introduces 2 interface flags, LINK_MASTER and LINK_SLAVE. - The bond module will set LINK_MASTER on the bond iface object indicating that the bond module owns the link. - Which means that all lower devices /slaves of the bond get their link when the bond (aka LINK_MASTER) is processed in the bond module - The module that queries dependencies propagates the LINK_SLAVE flags on the dependents of LINK_MASTER. - The scheduler now acts on the LINK_SLAVE flag. If LINK_SLAVE is set, it skips setting admin 'up' on that interface. It also makes sure the interface is not already in the bond. ie if an interface is a LINK_SLAVE (bond slave in this case), admin up will not be executed when the interface is not inside the bond. (cherry picked from commit 84b5a07a4f7685c7ae2eac5892889d6c0e08b2eb)
This commit is contained in:
@@ -105,6 +105,7 @@ class ifenslave(moduleBase):
|
||||
|
||||
# Also save a copy for future use
|
||||
ifaceobj.priv_data = list(slave_list)
|
||||
ifaceobj.flags |= iface.LINK_MASTER
|
||||
return slave_list
|
||||
|
||||
def get_dependent_ifacenames_running(self, ifaceobj):
|
||||
@@ -200,9 +201,8 @@ class ifenslave(moduleBase):
|
||||
self.log_warn('%s: skipping slave %s, does not exist'
|
||||
%(ifaceobj.name, slave))
|
||||
continue
|
||||
self.ifenslavecmd.enslave_slave(ifaceobj.name, slave,
|
||||
prehook=self.ipcmd.link_down,
|
||||
posthook=self.ipcmd.link_up)
|
||||
self.ipcmd.link_set(slave, 'master', ifaceobj.name)
|
||||
rtnetlink_api.rtnl_api.link_set(slave, "up")
|
||||
|
||||
def _apply_slaves_lacp_fallback_prio(self, ifaceobj):
|
||||
slaves = self.ifenslavecmd.get_slaves(ifaceobj.name)
|
||||
|
Reference in New Issue
Block a user