#318 ACLs with RegExp are very slow - aggressive resolver timeouts
This commit is contained in:
1
Changes
1
Changes
@@ -7,6 +7,7 @@
|
||||
[BUG FIXES]
|
||||
|
||||
* #320 DNS subroutines are redefined
|
||||
* #318 ACLs with RegExp are very slow - aggressive resolver timeouts
|
||||
|
||||
2.036001 - 2017-06-22
|
||||
|
||||
|
||||
@@ -103,12 +103,13 @@ sub check_acl {
|
||||
my $addr = NetAddr::IP::Lite->new($real_ip) or return 0;
|
||||
my $all = (scalar grep {m/^op:and$/} @$config);
|
||||
my $name = undef; # only look up once, and only if qr// is used
|
||||
my $ropt = { retry => 1, retrans => 1, udp_timeout => 1, tcp_timeout => 2 };
|
||||
|
||||
INLIST: foreach my $item (@$config) {
|
||||
next INLIST if $item eq 'op:and';
|
||||
|
||||
if (ref qr// eq ref $item) {
|
||||
$name = ($name || hostname_from_ip($addr->addr) || '!!none!!');
|
||||
$name = ($name || hostname_from_ip($addr->addr, $ropt) || '!!none!!');
|
||||
if ($name =~ $item) {
|
||||
return 1 if not $all;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user