]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
addons: addressvirtual: vrrp: protodown new macvlans
authorQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 19 Mar 2019 17:26:45 +0000 (17:26 +0000)
committerJulien Fortin <julien@cumulusnetworks.com>
Mon, 22 Apr 2019 02:55:47 +0000 (10:55 +0800)
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>
ifupdown2/addons/addressvirtual.py

index 140a9d0eff699ae74f0d017e94ac1883f0e44618..e90b9b44b8380a85a3e324b0b9b0b858a67c46ec 100644 (file)
@@ -417,7 +417,8 @@ class addressvirtual(moduleBase):
             if ifaceobj.link_privflags & ifaceLinkPrivFlags.VRF_SLAVE:
                 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:
                 try:
                     self.ipcmd.ipv6_addrgen(
@@ -428,6 +429,10 @@ class addressvirtual(moduleBase):
                 except Exception as e:
                     self.logger.warning("%s: %s: ip link set dev %s addrgenmode random: "
                                      "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:
                 self.ipcmd.ipv6_addrgen(macvlan_ifname, ipv6_addrgen_user_value, link_created)