]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
connections.cgi: Use new location lookup method.
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 5 Dec 2019 16:24:25 +0000 (17:24 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Fri, 6 Dec 2019 13:22:01 +0000 (14:22 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/connections.cgi

index 7399fea3cf395ffb181e849e9cfaff21dcc2ee2e..c27ff2ef761a70bebb550fd49e029ced97355cb9 100644 (file)
@@ -86,6 +86,9 @@ if ( $debug ){
 my @dummy = ( ${Header::table1colour} );
 undef (@dummy);
 
+# Init libloc database connection.
+my $libloc_db_handle = &GeoIP::init();
+
 # check sorting arguments
 if ( $cgiin{'sort_field'} ~~ [ '1','2','3','4','5','6','7','8','9' ] ) {
        $SORT_FIELD = $cgiin{'sort_field'};
@@ -551,9 +554,9 @@ foreach my $line (@conntrack) {
        my $bytes_out = format_bytes($bytes[1]);
 
        # enumerate GeoIP information
-       my $srcccode = &GeoIP::lookup($sip_ret);
+       my $srcccode = &GeoIP::lookup_country_code($libloc_db_handle, $sip_ret);
        my $src_flag_icon = &GeoIP::get_flag_icon($srcccode);
-       my $dstccode = &GeoIP::lookup($dip_ret);
+       my $dstccode = &GeoIP::lookup_country_code($libloc_db_handle, $dip_ret);
        my $dst_flag_icon = &GeoIP::get_flag_icon($dstccode);
 
        # Format TTL