mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
addons: addressvirtual: vrrp: protodown new macvlans
New VRRP macvlan devices should be set into protodown when first created, to prevent ND traffic and other automatically generated kernel traffic from being transmitted on the interface and causing downstream MAC moves. Reviewed-by: Julien Fortin <julien@cumulusnetworks.com> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
committed by
Julien Fortin
parent
1b9d23e8a0
commit
92c2d4a9e7
@@ -417,7 +417,8 @@ class addressvirtual(moduleBase):
|
|||||||
if ifaceobj.link_privflags & ifaceLinkPrivFlags.VRF_SLAVE:
|
if ifaceobj.link_privflags & ifaceLinkPrivFlags.VRF_SLAVE:
|
||||||
self._handle_vrf_slaves(macvlan_ifname, ifaceobj)
|
self._handle_vrf_slaves(macvlan_ifname, ifaceobj)
|
||||||
|
|
||||||
# if we are dealing with a VRRP macvlan we need to set addrgenmode to RANDOM
|
# if we are dealing with a VRRP macvlan we need to set addrgenmode
|
||||||
|
# to RANDOM, and protodown on
|
||||||
if vrrp:
|
if vrrp:
|
||||||
try:
|
try:
|
||||||
self.ipcmd.ipv6_addrgen(
|
self.ipcmd.ipv6_addrgen(
|
||||||
@@ -428,6 +429,10 @@ class addressvirtual(moduleBase):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.warning("%s: %s: ip link set dev %s addrgenmode random: "
|
self.logger.warning("%s: %s: ip link set dev %s addrgenmode random: "
|
||||||
"operation not supported: %s" % (ifname, macvlan_ifname, macvlan_ifname, str(e)))
|
"operation not supported: %s" % (ifname, macvlan_ifname, macvlan_ifname, str(e)))
|
||||||
|
try:
|
||||||
|
netlink.link_set_protodown(macvlan_ifname, "on")
|
||||||
|
except Exception as e:
|
||||||
|
self.logger.warning("%s: %s: ip link set dev %s protodown on: operation not supported: %s" % (ifname, macvlan_ifname, macvlan_ifname, str(e)))
|
||||||
elif user_configured_ipv6_addrgenmode:
|
elif user_configured_ipv6_addrgenmode:
|
||||||
self.ipcmd.ipv6_addrgen(macvlan_ifname, ipv6_addrgen_user_value, link_created)
|
self.ipcmd.ipv6_addrgen(macvlan_ifname, ipv6_addrgen_user_value, link_created)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user