From 9df839bead862726dac0a2231df73993146b9c42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 7 Jun 2023 11:40:21 +0200 Subject: [PATCH] api2: network: re-use existing variable tfilter MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- PVE/API2/Network.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm index 8dc56482..558d78a9 100644 --- a/PVE/API2/Network.pm +++ b/PVE/API2/Network.pm @@ -241,14 +241,14 @@ __PACKAGE__->register_method({ if (my $tfilter = $param->{type}) { my $vnets; - if ($have_sdn && $param->{type} eq 'any_bridge') { + if ($have_sdn && $tfilter eq 'any_bridge') { $vnets = PVE::Network::SDN::get_local_vnets(); # returns already access-filtered } for my $k (sort keys $ifaces->%*) { my $type = $ifaces->{$k}->{type}; - my $match = ($param->{type} eq $type) || ( - ($param->{type} =~ /^any(_local)?_bridge$/) && + my $match = ($tfilter eq $type) || ( + ($tfilter =~ /^any(_local)?_bridge$/) && ($type eq 'bridge' || $type eq 'OVSBridge')); delete $ifaces->{$k} if !$match; } -- 2.39.5