]> git.proxmox.com Git - pve-network.git/commitdiff
controller : evpn : only allow 1 evpn controller
authorAlexandre Derumier <aderumier@odiso.com>
Thu, 16 Jan 2020 08:15:16 +0000 (09:15 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 16 Jan 2020 09:47:28 +0000 (10:47 +0100)
we can only have 1 bgp router on a server

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
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";
     }
 }