fix GeoIP lookup in showrequestfromcountry.dat

Message ID 20180107135211.48b6848f.peter.mueller@link38.eu
State Accepted
Commit d894ef3615b1f3d2a4ed8f78c8fb24083dc9cc57
Headers
Series fix GeoIP lookup in showrequestfromcountry.dat |

Commit Message

Peter Müller Jan. 7, 2018, 11:52 p.m. UTC
  This issue was caused by the rewrite of the perl GeoIP
library.

Fixes #11571.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
---
 html/cgi-bin/logs.cgi/showrequestfromcountry.dat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Matthias Fischer Jan. 8, 2018, 12:17 a.m. UTC | #1
Hi,

On 07.01.2018 13:52, Peter Müller wrote:
> This issue was caused by the rewrite of the perl GeoIP
> library.
> 
> Fixes #11571.

Tested. Works. Thanks! ;-)

That was fast...

Best,
Matthias

> Signed-off-by: Peter Müller <peter.mueller@link38.eu>
> ---
>  html/cgi-bin/logs.cgi/showrequestfromcountry.dat | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/html/cgi-bin/logs.cgi/showrequestfromcountry.dat b/html/cgi-bin/logs.cgi/showrequestfromcountry.dat
> index 605873ac0..69835370b 100644
> --- a/html/cgi-bin/logs.cgi/showrequestfromcountry.dat
> +++ b/html/cgi-bin/logs.cgi/showrequestfromcountry.dat
> @@ -349,7 +349,7 @@ foreach $_ (@slice)
>  	if($iface eq $country || $srcaddr ne '') {
>  		my $ccode='';
>  		if($iface ne $country) {
> -			$ccode = $gi->country_code_by_name($srcaddr);
> +			$ccode = &GeoIP::lookup($srcaddr);
>  		}
>  		if($iface eq $country || $ccode eq uc($country)) {
>  			my $chain = '';
>
  

Patch

diff --git a/html/cgi-bin/logs.cgi/showrequestfromcountry.dat b/html/cgi-bin/logs.cgi/showrequestfromcountry.dat
index 605873ac0..69835370b 100644
--- a/html/cgi-bin/logs.cgi/showrequestfromcountry.dat
+++ b/html/cgi-bin/logs.cgi/showrequestfromcountry.dat
@@ -349,7 +349,7 @@  foreach $_ (@slice)
 	if($iface eq $country || $srcaddr ne '') {
 		my $ccode='';
 		if($iface ne $country) {
-			$ccode = $gi->country_code_by_name($srcaddr);
+			$ccode = &GeoIP::lookup($srcaddr);
 		}
 		if($iface eq $country || $ccode eq uc($country)) {
 			my $chain = '';