mirror of
git://git.proxmox.com/git/pve-common.git
synced 2025-01-08 01:17:37 +03:00
INotify: simplify lookup_type_prio
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
51eec39065
commit
0c0bcf7cdc
@ -1516,20 +1516,12 @@ NETWORKDOC
|
|||||||
|
|
||||||
my $lookup_type_prio = sub {
|
my $lookup_type_prio = sub {
|
||||||
my ($iface, $ifaces) = @_;
|
my ($iface, $ifaces) = @_;
|
||||||
my $child = 0;
|
|
||||||
my $n = undef;
|
|
||||||
|
|
||||||
my $i=1;
|
my ($rootiface, @rest) = split(/[.:]/, $iface);
|
||||||
for my $childiface (split(/(\.|:)/, $iface)) {
|
my $childlevel = scalar(@rest);
|
||||||
if ($i > 1) {
|
my $n = $ifaces->{$rootiface};
|
||||||
$child++;
|
|
||||||
} else {
|
|
||||||
$n = $ifaces->{$childiface};
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $pri = $if_type_hash->{$n->{type}} + $child
|
my $pri = $if_type_hash->{$n->{type}} + $childlevel
|
||||||
if $n->{type} && $n->{type} ne 'unknown';
|
if $n->{type} && $n->{type} ne 'unknown';
|
||||||
|
|
||||||
return $pri;
|
return $pri;
|
||||||
|
Loading…
Reference in New Issue
Block a user