From a15a182b2cf6ed3a64cfb48bbf59519d086d98f3 Mon Sep 17 00:00:00 2001 From: Doug Freed Date: Wed, 13 Jan 2016 22:09:28 -0700 Subject: More bugfixes and improvements - Request and save the real IP when syncing - Handle our nick not matching what we want it to be when we're kicked - Minor style consistency fix - Greatly improve channel syncing - Retrieve hostname/IP bans and quiets better - Clean up generation of reversed IP for DNSBL checking - Improve getHostIP's detection of real hostnames --- lib/ASM/Util.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/ASM/Util.pm') 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); -- cgit v1.2.3