mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
bond: support for protodown reason bit settings for clag/frr
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
This commit is contained in:
@ -381,6 +381,10 @@ class bond(Addon, moduleBase):
|
||||
if clag_bond or ifaceobj.link_privflags & ifaceLinkPrivFlags.ES_BOND:
|
||||
try:
|
||||
self.netlink.link_set_protodown_on(slave)
|
||||
if clag_bond:
|
||||
self.iproute2.link_set_protodown_reason_clag_on(slave)
|
||||
else:
|
||||
self.iproute2.link_set_protodown_reason_frr_on(slave)
|
||||
except Exception as e:
|
||||
self.logger.error('%s: %s' % (ifaceobj.name, str(e)))
|
||||
|
||||
@ -406,13 +410,14 @@ class bond(Addon, moduleBase):
|
||||
for s in runningslaves:
|
||||
# make sure that slaves are not in protodown since we are not in the clag-bond or es-bond case
|
||||
if not clag_bond and not ifaceobj.link_privflags & ifaceLinkPrivFlags.ES_BOND and self.cache.get_link_protodown(s):
|
||||
self.iproute2.link_set_protodown_reason_clag_off(s)
|
||||
self.netlink.link_set_protodown_off(s)
|
||||
|
||||
if s not in slaves:
|
||||
self.sysfs.bond_remove_slave(ifaceobj.name, s)
|
||||
removed_slave.append(s)
|
||||
if clag_bond:
|
||||
try:
|
||||
self.iproute2.link_set_protodown_reason_clag_off(s)
|
||||
self.netlink.link_set_protodown_off(s)
|
||||
except Exception as e:
|
||||
self.logger.error('%s: %s' % (ifaceobj.name, str(e)))
|
||||
|
@ -427,6 +427,18 @@ class IPRoute2(Cache, Requirements):
|
||||
def link_add_openvswitch(self, ifname, kind):
|
||||
self.__update_cache_after_link_creation(ifname, kind)
|
||||
|
||||
def link_set_protodown_reason_clag_on(self, ifname):
|
||||
utils.exec_command("%s link set dev %s protodown_reason clag on" % (utils.ip_cmd, ifname))
|
||||
|
||||
def link_set_protodown_reason_clag_off(self, ifname):
|
||||
utils.exec_command("%s link set dev %s protodown_reason clag off" % (utils.ip_cmd, ifname))
|
||||
|
||||
def link_set_protodown_reason_frr_on(self, ifname):
|
||||
utils.exec_command("%s link set dev %s protodown_reason frr on" % (utils.ip_cmd, ifname))
|
||||
|
||||
def link_set_protodown_reason_frr_off(self, ifname):
|
||||
utils.exec_command("%s link set dev %s protodown_reason frr off" % (utils.ip_cmd, ifname))
|
||||
|
||||
############################################################################
|
||||
# TUNNEL
|
||||
############################################################################
|
||||
|
Reference in New Issue
Block a user