Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

merge gunnar wolf's ipv6 changes

  • Loading branch information...
commit 0bec752ec23367b524178ff9a5cc52d335ad2987 1 parent 23e29d7
@mla authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 ip2host
View
12 ip2host
@@ -8,8 +8,6 @@
# For a usage summary, run: ip2host --usage
# For documentation, run: perldoc ip2host
-# $Id: ip2host 24 2007-01-27 05:33:06Z mla $
-
our $CHILDREN = 40; # Number of processes to fork
our $TIMEOUT = 20; # DNS timeout
our $BUFFER = 50000; # Maximum number of log lines to keep in memory
@@ -30,7 +28,7 @@ use IO::Handle;
use IO::Select;
use Getopt::Long;
-our $VERSION = '1.10';
+our $VERSION = '1.12';
BEGIN {
package IP_Cache;
@@ -115,13 +113,15 @@ sub resolve_ips($) {
chomp($ip);
my $host = undef;
eval { # Try to resolve, but give up after $TIMEOUT seconds
- my ($ip_struct);
alarm($Opt{timeout});
+
+ my $ip_struct;
if ($ip_struct = inet_aton($ip)) {
- $host = gethostbyaddr $ip_struct, AF_INET;
+ $host = gethostbyaddr $ip_struct, AF_INET;
} elsif ($ip_struct = Socket::inet_pton(AF_INET6, $ip)) {
- $host = gethostbyaddr $ip_struct, AF_INET6;
+ $host = gethostbyaddr $ip_struct, AF_INET6;
}
+
alarm(0);
};
# XXX Debug
Please sign in to comment.
Something went wrong with that request. Please try again.