]> git.proxmox.com Git - mirror_ifupdown2.git/blobdiff - ifupdown2/addons/addressvirtual.py
addons: addressvirtual: flush macvlan addr cache when setting addrgenmode
[mirror_ifupdown2.git] / ifupdown2 / addons / addressvirtual.py
index 9c0cb7df6284bc9f78d0c7ad35d7f06276dfbbcc..c5a7c2f4a1ed25eda7d795ab251a89ed0299c222 100644 (file)
@@ -243,6 +243,13 @@ class addressvirtual(moduleBase):
                 except:
                     self.ipcmd.link_add_macvlan(ifaceobj.name, macvlan_ifacename)
                 link_created = True
+            else:
+                if should_configure_ipv6_addrgen:
+                    # When setting addrgenmode it is necessary to flap the macvlan
+                    # device. After flapping the device we also need to re-add all
+                    # the user configuration. The best way to add the user config
+                    # is to flush our internal address cache
+                    self.ipcmd.reset_addr_cache(macvlan_ifacename)
 
             # first thing we need to handle vrf enslavement
             if (ifaceobj.link_privflags & ifaceLinkPrivFlags.VRF_SLAVE):