forked from extern/shorewall_code
Unconditionally cache interface lookup results
This commit is contained in:
parent
845a4f40fd
commit
0d550d9bce
@ -1187,7 +1187,7 @@ sub map_physical( $$ ) {
|
|||||||
# If the passed name matches a wildcard and 'cache' is true, an entry for the name is added in
|
# If the passed name matches a wildcard and 'cache' is true, an entry for the name is added in
|
||||||
# %interfaces.
|
# %interfaces.
|
||||||
#
|
#
|
||||||
sub known_interface($;$)
|
sub known_interface($)
|
||||||
{
|
{
|
||||||
my ( $interface, $cache ) = @_;
|
my ( $interface, $cache ) = @_;
|
||||||
my $interfaceref = $interfaces{$interface};
|
my $interfaceref = $interfaces{$interface};
|
||||||
@ -1202,17 +1202,13 @@ sub known_interface($;$)
|
|||||||
if ( $i ne $root && $interface ne $root && substr( $interface, 0, length $root ) eq $root ) {
|
if ( $i ne $root && $interface ne $root && substr( $interface, 0, length $root ) eq $root ) {
|
||||||
my $physical = map_physical( $interface, $interfaceref );
|
my $physical = map_physical( $interface, $interfaceref );
|
||||||
|
|
||||||
my $copyref = { options => $interfaceref->{options},
|
return $interfaces{$interface} = { options => $interfaceref->{options},
|
||||||
bridge => $interfaceref->{bridge} ,
|
bridge => $interfaceref->{bridge} ,
|
||||||
name => $i ,
|
name => $i ,
|
||||||
number => $interfaceref->{number} ,
|
number => $interfaceref->{number} ,
|
||||||
physical => $physical ,
|
physical => $physical ,
|
||||||
base => chain_base( $physical ) ,
|
base => chain_base( $physical ) ,
|
||||||
};
|
};
|
||||||
|
|
||||||
$interfaces{$interface} = $copyref if $cache;
|
|
||||||
|
|
||||||
return $copyref;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user