From 87ff065c98a211ea4ced5e65f83fe4aa4bc51782 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 23 Oct 2020 21:09:23 +0200 Subject: [PATCH] network: fix conditional variable declaration Signed-off-by: Thomas Lamprecht --- src/PVE/INotify.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm index 5ff95a8..cf6ef57 100644 --- a/src/PVE/INotify.pm +++ b/src/PVE/INotify.pm @@ -1674,12 +1674,10 @@ NETWORKDOC my ($rootiface, @rest) = split(/[.:]/, $iface); my $childlevel = scalar(@rest); - my $n = $ifaces->{$rootiface}; + my $type = $ifaces->{$rootiface}->{type}; + return if !$type || $type eq 'unknown'; - my $pri = $if_type_hash->{$n->{type}} + $childlevel - if $n->{type} && $n->{type} ne 'unknown'; - - return $pri; + return $if_type_hash->{$type} + $childlevel }; foreach my $iface (sort { -- 2.39.2