[pve-devel] [PATCH pve-network 1/3] controller: evpn: fix find_bgp_controller

Alexandre Derumier aderumier at odiso.com
Wed Sep 13 13:38:40 CEST 2023


---
 src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index 6da9c40..fd4b801 100644
--- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -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) = @_;
 
-- 
2.39.2





More information about the pve-devel mailing list