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

[Change by Roopa] To prevent ifupdown2 setting clag-bond slave states on ifup.

Ticket: CM-4802
Reviewed By: CCR-2507
Testing Done: Yes

1. For clag bonds the slaves are kept down under various conditions (when clagd
is holding the bond in an errDisabled state). ifupdown2 should not set the slave
states for clag bonds.
2. Bonding driver sets the slave states on enslave and release (also for
non-clag bonds) so ifupdown2 doesn't need to set the slave state.
This commit is contained in:
anuradhak
2015-02-02 08:46:47 -08:00
parent 64db332a85
commit 67b8126335

View File

@@ -121,7 +121,11 @@ class ifenslave(moduleBase):
# Also save a copy for future use
ifaceobj.priv_data = list(slave_list)
if ifaceobj.link_type != ifaceLinkType.LINK_NA:
# if clag-id is non-zero then clagd controls the slave states
attrval = ifaceobj.get_attr_value_first('clag-id')
clag_id = attrval if attrval else '0'
if (ifaceobj.link_type != ifaceLinkType.LINK_NA or
clag_id != '0'):
ifaceobj.link_type = ifaceLinkType.LINK_MASTER
return slave_list
@@ -224,6 +228,8 @@ class ifenslave(moduleBase):
[ self.ifenslavecmd.remove_slave(ifaceobj.name, s)
for s in runningslaves if s not in slaves ]
attrval = ifaceobj.get_attr_value_first('clag-id')
clag_id = attrval if attrval else '0'
for slave in Set(slaves).difference(Set(runningslaves)):
if (not self.PERFMODE and
not self.ipcmd.link_exists(slave)):
@@ -235,7 +241,9 @@ class ifenslave(moduleBase):
rtnetlink_api.rtnl_api.link_set(slave, "down")
link_up = True
self.ipcmd.link_set(slave, 'master', ifaceobj.name)
if link_up or ifaceobj.link_type != ifaceLinkType.LINK_NA:
# for clag bonds clagd controls the state of the clag slaves
if clag_id == '0' and (link_up or\
ifaceobj.link_type != ifaceLinkType.LINK_NA):
rtnetlink_api.rtnl_api.link_set(slave, "up")
def _apply_slaves_lacp_bypass_prio(self, ifaceobj):