diff --git a/Changes b/Changes index 1b280044..ddd5bda6 100644 --- a/Changes +++ b/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 diff --git a/lib/App/Netdisco/Util/Permission.pm b/lib/App/Netdisco/Util/Permission.pm index 19f21f47..cabdd3d0 100644 --- a/lib/App/Netdisco/Util/Permission.pm +++ b/lib/App/Netdisco/Util/Permission.pm @@ -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; }