]> git.proxmox.com Git - pve-network.git/blobdiff - PVE/Network/SDN/Controllers/EvpnPlugin.pm
controller : evpn : only allow 1 evpn controller
[pve-network.git] / PVE / Network / SDN / Controllers / EvpnPlugin.pm
index 6369c455871a1452c41932741cc8da24360c72c2..034cb93b1e42c4cb7befbf4f7fc9bdf62e4fe023 100644 (file)
@@ -167,13 +167,12 @@ sub on_delete_hook {
 sub on_update_hook {
     my ($class, $controllerid, $controller_cfg) = @_;
 
-    # verify that asn is not already used by another controller
-    my $asn = $controller_cfg->{ids}->{$controllerid}->{asn};
+    # we can only have 1 evpn controller / 1 asn by server
+
     foreach my $id (keys %{$controller_cfg->{ids}}) {
        next if $id eq $controllerid;
         my $controller = $controller_cfg->{ids}->{$id};
-        die "asn $asn is already used by $id"
-            if (defined($controller->{asn}) && $controller->{asn} eq $asn);
+        die "only 1 evpn controller can be defined" if $controller->{type} eq "evpn";
     }
 }