]> git.proxmox.com Git - mirror_ifupdown2.git/blobdiff - ifupdown2/ifupdownaddons/LinkUtils.py
addons: addressvirtual: vrrp: set addrgen mode random on VRRP macvlans
[mirror_ifupdown2.git] / ifupdown2 / ifupdownaddons / LinkUtils.py
index 69ffd9ea25e2223606b87545d4999c06b303431e..368441482f1ae851e22e0b5b24dd1579c2456860 100644 (file)
@@ -2750,17 +2750,18 @@ class LinkUtils(utilsBase):
             # is to flush our internal address cache
             self.reset_addr_cache(ifname)
 
-        cmd = 'link set dev %s addrgenmode %s' % (ifname, 'none' if addrgen else 'eui64')
+        cmd = 'link set dev %s addrgenmode %s' % (ifname, Link.ifla_inet6_addr_gen_mode_dict.get(addrgen))
 
         is_link_up = self.is_link_up(ifname)
 
         if is_link_up:
             self.link_down(ifname)
 
-        if LinkUtils.ipbatch:
-            self.add_to_batch(cmd)
-        else:
-            utils.exec_command('%s %s' % (utils.ip_cmd, cmd))
+        #if LinkUtils.ipbatch:
+        #    self.add_to_batch(cmd)
+        #else:
+        # because this command might fail on older kernel its better to not batch it
+        utils.exec_command('%s %s' % (utils.ip_cmd, cmd))
 
         if is_link_up:
             self.link_up(ifname)