controller: evpn: fix find_bgp_controller

This commit is contained in:
Alexandre Derumier 2023-09-13 13:38:40 +02:00 committed by Fabian Grünbichler
parent e45154299d
commit e1ab3d7c28

View file

@ -295,18 +295,17 @@ sub on_update_hook {
sub find_bgp_controller {
my ($nodename, $controller_cfg) = @_;
my $controller = undef;
my $res = undef;
foreach my $id (keys %{$controller_cfg->{ids}}) {
$controller = $controller_cfg->{ids}->{$id};
next if $controller->{type} ne 'bgp';
next if $controller->{node} ne $nodename;
my $controller = $controller_cfg->{ids}->{$id};
next if $controller->{type} ne 'bgp';
next if $controller->{node} ne $nodename;
$res = $controller;
last;
}
return $controller;
return $res;
}
sub generate_frr_recurse{
my ($final_config, $content, $parentkey, $level) = @_;