diff options
Diffstat (limited to 'lib/ASM/Util.pm')
| -rw-r--r-- | lib/ASM/Util.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ASM/Util.pm b/lib/ASM/Util.pm index 1f0b4d9..3ec0cd9 100644 --- a/lib/ASM/Util.pm +++ b/lib/ASM/Util.pm @@ -241,14 +241,14 @@ sub getHostIP ($host =~ /^gateway\/web\/.*\/ip\.(\d+)\.(\d+)\.(\d+)\.(\d+)$/) ) { #yay, easy IP! return dottedQuadToInt(undef, "$1.$2.$3.$4"); - } elsif (index($host, '/') != -1) { - return; } elsif ($host =~ /^2001:0:/) { my @splitip = split(/:/, $host); return unless defined($splitip[6]) && defined($splitip[7]); #I think I can just do (hex($splitip[6] . $splitip[7]) ^ hex('ffffffff')) here but meh my $host = join('.', unpack('C4', pack('N', (hex($splitip[6] . $splitip[7])^hex('ffffffff'))))); return dottedQuadToInt(undef, $host); + } elsif ($host !~ /^(([a-z0-9]([a-z0-9\-]*[a-z0-9])?\.)*([a-z0-9]([a-z0-9\-]*[a-z0-9])?\.?))$/i) { + return; } $ENV{RES_OPTIONS} = "timeout:1 attempts:1"; my @resolve = gethostbyname($host); |
