summaryrefslogtreecommitdiffstats
path: root/lib/ASM/Util.pm
diff options
context:
space:
mode:
authorLibravatarDoug Freed <dwfreed@mtu.edu>2016-01-13 22:09:28 -0700
committerLibravatarDoug Freed <dwfreed@mtu.edu>2016-01-13 22:09:28 -0700
commita15a182b2cf6ed3a64cfb48bbf59519d086d98f3 (patch)
tree38a8cb91dfc5f88b97bf5d2aad026e44520f4580 /lib/ASM/Util.pm
parentaa8fb99e32987c4da8871607fa94d70577c39495 (diff)
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
Diffstat (limited to 'lib/ASM/Util.pm')
-rw-r--r--lib/ASM/Util.pm4
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);