logs.cgi/*: Use new location lookup method.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2019-12-06 14:30:39 +01:00
parent 87bc6401bc
commit 50494dfd6e
4 changed files with 16 additions and 4 deletions

View File

@@ -24,6 +24,9 @@ require "${General::swroot}/geoip-functions.pl";
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
# Libloc database handle.
my $libloc_db_handle = &GeoIP::init();
my %color = ();
my %mainsettings = ();
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
@@ -351,7 +354,7 @@ foreach $_ (@log)
$srcport=$1 if $packet =~ /SPT=(\d+)/;
$dstport=$1 if $packet =~ /DPT=(\d+)/;
my $ccode = &GeoIP::lookup($srcaddr);
my $ccode = &GeoIP::lookup_country_code($libloc_db_handle, $srcaddr);
my $servi = uc(getservbyport($srcport, lc($proto)));
if ($servi ne '' && $srcport < 1024) {