[pve-devel] [PATCH pve-network 2/2] controller : evpn : only allow 1 evpn controller
Alexandre Derumier
aderumier at odiso.com
Thu Jan 16 09:15:16 CET 2020
we can only have 1 bgp router on a server
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/Network/SDN/Controllers/EvpnPlugin.pm | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index 6369c45..034cb93 100644
--- a/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -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";
}
}
--
2.20.1
More information about the pve-devel
mailing list