Description: Silences unhelpful error messages when IP cannot be resolved
Origin: other
Author: Andrew McNaughton <andrew@scoop.co.nz>
Reviewed-by: Gunnar Wolf <gwolf@debian.org>
Bug-Debian: http://bugs.debian.org/563129
Forwarded: yes, private mail to author
Last-Update: 2010-02-18

--- ip2host-1.10.orig/ip2host
+++ ip2host-1.10/ip2host
@@ -116,8 +116,9 @@ sub resolve_ips($) {
     my $host = undef;
     eval { # Try to resolve, but give up after $TIMEOUT seconds
       alarm($Opt{timeout});
-      my $ip_struct = inet_aton $ip;
-      $host = gethostbyaddr $ip_struct, AF_INET;
+      if (my $ip_struct = inet_aton $ip) {
+	  $host = gethostbyaddr $ip_struct, AF_INET;
+      }
       alarm(0);
     };
     # XXX Debug
