]> git.proxmox.com Git - pve-network.git/blobdiff - PVE/Network/SDN/Controllers/Plugin.pm
limit vnet/zones/controller to 10 characters
[pve-network.git] / PVE / Network / SDN / Controllers / Plugin.pm
index df385f1ae183af3b9ed44bfba54200f0421c5b22..3aed73ab1729ffd36c7b3ef58a185222b740d31a 100644 (file)
@@ -27,10 +27,11 @@ PVE::JSONSchema::register_format('pve-sdn-controller-id', \&parse_sdn_controller
 sub parse_sdn_controller_id {
     my ($id, $noerr) = @_;
 
-    if ($id !~ m/^[a-z][a-z0-9\-\_\.]*[a-z0-9]$/i) {
+    if ($id !~ m/^[a-z][a-z0-9]*[a-z0-9]$/i) {
         return undef if $noerr;
-        die "SDN controller object ID '$id' contains illegal characters\n";
+        die "controller ID '$id' contains illegal characters\n";
     }
+    die "controller ID '$id' can't be more length than 10 characters\n" if length($id) > 10;
     return $id;
 }