Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#427 plugin geoip doesn't find countries for resolved host [+fix]

closed
9
2012-10-11
2005-04-12
Styx31
No

I'm using Geo::IP::PurePerl and have discovered a small
bug in the host part of the html.

When hostnames are resolved, when geoip.pm is asked for
ShowInfoHost_geoip(), he doesn't find country code for
the hostname.

The bug is at line 169 of the file :

if (! $key) {
my $res=lc($gi->country_code_by_addr($param))
if $gi;
if ($Debug) { debug(" Plugin geoip:
GetCountryByHostname for $param: [$res]",5); }
if ($res) { print $DomainsHashIDLib{$res}; }
else { print "<span style=\"color:

$color_other\">$Message[0]"; }

}

'country_code_by_addr' is not the correct function in
this case (hostname resolved), and the function that
must be called is 'country_code_by_name'.

'country_code_by_addr' is correctly used some lines
before, for resolving country for ip.

I've tried to remplace the code with success.

I think it's only a bad copy/paste (4 hours of debug...)

Anyway, good job :)

Discussion

  • Logged In: YES
    user_id=96898

    Added/Fixed in CVS tree. Will be available in next version.

     
  • Charles Fry
    Charles Fry
    2005-10-19

    Logged In: YES
    user_id=237933

    This was also reported as Debian bug #317310.