+ifupdown2 (3.0.1-1) unstable; urgency=medium
+
+ * New. Enabled: ES bond with "es-sys-mac" attribute
+
+ -- Julien Fortin <julien@cumulusnetworks.com> Tue, 14 Apr 2020 23:42:42 +0200
+
ifupdown2 (3.0.0-1) unstable; urgency=medium
* New. Enabled: python3 support
* Fix: mstpctl: check mstpctl-stp and bridge-stp and fix bridge cache update
* Removing python-argcomplete dependency
- -- Julien Fortin <julien@cumulusnetworks.com> Tue, 14 Apr 2020 19:10:49 +0200
+ -- Julien Fortin <julien@cumulusnetworks.com> Tue, 14 Apr 2020 23:42:42 +0200
ifupdown2 (2.0.2-1) unstable; urgency=medium
"2", "failure",
],
"example": ["bond-primary-reselect failure"]
+ },
+ "es-sys-mac": {
+ "help": "evpn-mh: system mac address",
+ "validvals": ["<mac>", ],
+ "example": ["bond-ad-actor-system 00:00:00:00:00:42"],
}
}
}
'bond-min-links': Link.IFLA_BOND_MIN_LINKS,
'bond-num-grat-arp': Link.IFLA_BOND_NUM_PEER_NOTIF,
'bond-num-unsol-na': Link.IFLA_BOND_NUM_PEER_NOTIF,
+ 'es-sys-mac': Link.IFLA_BOND_AD_ACTOR_SYSTEM,
'bond-ad-sys-mac-addr': Link.IFLA_BOND_AD_ACTOR_SYSTEM,
'bond-ad-actor-system': Link.IFLA_BOND_AD_ACTOR_SYSTEM,
'bond-ad-sys-priority': Link.IFLA_BOND_AD_ACTOR_SYS_PRIO,
('bond-use-carrier', Link.IFLA_BOND_USE_CARRIER, lambda x: int(utils.get_boolean_from_string(x))),
('bond-lacp-rate', Link.IFLA_BOND_AD_LACP_RATE, lambda x: int(utils.get_boolean_from_string(x))),
('bond-lacp-bypass-allow', Link.IFLA_BOND_AD_LACP_BYPASS, lambda x: int(utils.get_boolean_from_string(x))),
+ ('es-sys-mac', Link.IFLA_BOND_AD_ACTOR_SYSTEM, str),
('bond-ad-sys-mac-addr', Link.IFLA_BOND_AD_ACTOR_SYSTEM, str),
('bond-ad-actor-system', Link.IFLA_BOND_AD_ACTOR_SYSTEM, str),
('bond-primary-reselect', Link.IFLA_BOND_PRIMARY_RESELECT, lambda x: Link.ifla_bond_primary_reselect_tbl[x])
ifaceobj.link_kind |= ifaceLinkKind.BOND
ifaceobj.role |= ifaceRole.MASTER
+ if ifaceobj.get_attr_value("es-sys-mac"):
+ ifaceobj.link_privflags |= ifaceLinkPrivFlags.ES_BOND
+
return slave_list
def syntax_check(self, ifaceobj, ifaceobj_getfunc):
if self.cache.link_is_up(slave):
self.netlink.link_down_force(slave)
link_up = True
- # If clag bond place the slave in a protodown state; clagd
- # will protoup it when it is ready
- if clag_bond:
+
+ # if clag or ES bond: place the slave in a protodown state;
+ # (clagd will proto-up it when it is ready)
+ if clag_bond or ifaceobj.link_privflags & ifaceLinkPrivFlags.ES_BOND:
try:
self.netlink.link_set_protodown_on(slave)
except Exception as e:
for lower_dev in ifaceobj.lowerifaces:
self.netlink.link_set_nomaster(lower_dev)
+
+ # when unslaving a device from an ES bond we need to set
+ # protodown off
+ if ifaceobj.link_privflags & ifaceLinkPrivFlags.ES_BOND:
+ self.netlink.link_set_protodown_off(lower_dev)
+
try:
bond_slaves.remove(lower_dev)
except:
'bond-lacp-rate': self.translate_nl_value_slowfast(cached_vxlan_ifla_info_data.get(Link.IFLA_BOND_AD_LACP_RATE)),
'bond-min-links': cached_vxlan_ifla_info_data.get(Link.IFLA_BOND_MIN_LINKS),
'bond-ad-actor-system': cached_vxlan_ifla_info_data.get(Link.IFLA_BOND_AD_ACTOR_SYSTEM),
+ 'es-sys-mac': cached_vxlan_ifla_info_data.get(Link.IFLA_BOND_AD_ACTOR_SYSTEM),
'bond-ad-actor-sys-prio': cached_vxlan_ifla_info_data.get(Link.IFLA_BOND_AD_ACTOR_SYS_PRIO),
'bond-xmit-hash-policy': Link.ifla_bond_xmit_hash_policy_pretty_tbl.get(cached_vxlan_ifla_info_data.get(Link.IFLA_BOND_XMIT_HASH_POLICY)),
'bond-lacp-bypass-allow': self.translate_nl_value_yesno(cached_vxlan_ifla_info_data.get(Link.IFLA_BOND_AD_LACP_BYPASS)),
"""
return self.get_link_attribute(ifname, Link.IFLA_IFALIAS)
+ def get_link_protodown(self, ifname):
+ """
+ Return link IFLA_PROTO_DOWN
+ :param ifname:
+ :return: int
+ """
+ return self.get_link_attribute(ifname, Link.IFLA_PROTO_DOWN)
+
def get_link_attribute(self, ifname, attr, default=None):
"""
Return link attribute 'attr'.value
"""
Bring ifname up by setting IFLA_PROTO_DOWN on
"""
+ if self.cache.get_link_protodown(ifname) == 1:
+ return True
+
self.logger.info("%s: netlink: set link %s protodown on" % (ifname, ifname))
try:
self.__link_set_protodown(ifname, 1)
"""
Take ifname down by setting IFLA_PROTO_DOWN off
"""
+ if self.cache.get_link_protodown(ifname) == 0:
+ return True
+
self.logger.info("%s: netlink: set link %s protodown off" % (ifname, ifname))
try:
self.__link_set_protodown(ifname, 0)