]> git.proxmox.com Git - mirror_ifupdown2.git/blobdiff - ifupdown2/addons/addressvirtual.py
addons: addressvirtual: check macvlan interface name lenght and war if len > 15
[mirror_ifupdown2.git] / ifupdown2 / addons / addressvirtual.py
index 55d3f5173f329b285721e5ee0d080b10d72d5388..cf9d6d4b8eb90fa934e49b7bf189230ea4e2edd0 100644 (file)
@@ -437,6 +437,11 @@ class addressvirtual(AddonWithIpBlackList, moduleBase):
             macvlan_mode = intf_config_dict.get("mode")
             ips = intf_config_dict.get("ips")
 
+            if len(macvlan_ifname) > 15:
+                self.logger.error("%s: macvlan name will exceed the 15 chars limitation - please rename the underlying interface (%s)" % (macvlan_ifname, ifname))
+                ifaceobj.set_status(ifaceStatus.ERROR)
+                continue
+
             for ip in ips:
                 self.ip_blacklist_check(ifname, ip)