#808 avoid dns for node search on IPish thing
This commit is contained in:
@@ -211,7 +211,9 @@ get '/ajax/content/search/node' => require_login sub {
|
|||||||
->search_by_name({nbname => $likeval, @active, @times});
|
->search_by_name({nbname => $likeval, @active, @times});
|
||||||
|
|
||||||
unless ( $set->has_rows ) {
|
unless ( $set->has_rows ) {
|
||||||
if (my $ip = NetAddr::IP::Lite->new($node)) {
|
if ($node =~ m{^(?:$RE{net}{IPv4}|$RE{net}{IPv6})(?:/\d+)?$}i
|
||||||
|
and my $ip = NetAddr::IP::Lite->new($node)) {
|
||||||
|
|
||||||
# search_by_ip() will extract cidr notation if necessary
|
# search_by_ip() will extract cidr notation if necessary
|
||||||
$set = schema('netdisco')->resultset('NodeIp')
|
$set = schema('netdisco')->resultset('NodeIp')
|
||||||
->search_by_ip({ip => $ip, @active, @times});
|
->search_by_ip({ip => $ip, @active, @times});
|
||||||
|
|||||||
Reference in New Issue
Block a user