]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/INotify.pm
network: fix conditional variable declaration
[pve-common.git] / src / PVE / INotify.pm
index 5ff95a88d80494e33faf8a1b62afec9c71825a6b..cf6ef57ab6608baf4506a571143e2fa774203c13 100644 (file)
@@ -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 {