X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fipinfo.cgi;h=71098a2529f8ed1c1e71cee3cfef06f4c91200b0;hb=8ba55ea6bbea2d0ab739a882b7569757428e589c;hp=bc214f09525d8bb38d0f11d0cc6c573a87f53065;hpb=850723661e89157f87df9ca2eb654664adee07e4;p=people%2Fpmueller%2Fipfire-2.x.git diff --git a/html/cgi-bin/ipinfo.cgi b/html/cgi-bin/ipinfo.cgi index bc214f0952..71098a2529 100644 --- a/html/cgi-bin/ipinfo.cgi +++ b/html/cgi-bin/ipinfo.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# Copyright (C) 2010 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -39,8 +39,6 @@ my %cgiparams=(); $ENV{'QUERY_STRING'} =~s/&//g; my @addrs = split(/ip=/,$ENV{'QUERY_STRING'}); -my %whois_servers = ("RIPE"=>"whois.ripe.net","APNIC"=>"whois.apnic.net","LACNIC"=>"whois.lacnic.net"); - &Header::openpage($Lang::tr{'ip info'}, 1, ''); &Header::openbigbox('100%', 'left'); @@ -58,15 +56,15 @@ next if $addr eq ""; my $sock = new IO::Socket::INET ( PeerAddr => $whoisname, PeerPort => 43, Proto => 'tcp'); if ($sock) { - print $sock "$addr\n"; + print $sock "n $addr\n"; while (<$sock>) { - $extraquery = $1 if (/NetType: Allocated to (\S+)\s+/); + $extraquery = $1 if (/ReferralServer: whois:\/\/(\S+)\s+/); push(@lines,$_); } close($sock); if ($extraquery) { undef (@lines); - $whoisname = $whois_servers{$extraquery}; + $whoisname = $extraquery; my $sock = new IO::Socket::INET ( PeerAddr => $whoisname, PeerPort => 43, Proto => 'tcp'); if ($sock) {