From patchwork Mon Apr 5 13:36:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 4104 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FDWs53PmMz3yBV for ; Mon, 5 Apr 2021 13:36:25 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FDWs42vGBzBZ; Mon, 5 Apr 2021 13:36:24 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FDWs41D73z2xTN; Mon, 5 Apr 2021 13:36:24 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FDWs21YTpz2xKk for ; Mon, 5 Apr 2021 13:36:22 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4FDWs118qxzBZ; Mon, 5 Apr 2021 13:36:21 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1617629781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=uCmIBk5j6P1YOyqLFJyEv+kBUzlXjBUi7th84ZIJAmQ=; b=e3JFIu3n8oFUUWl3HsROKNsvWHGTofRPHkddXmFZ/h1CCfu4htpYlnLlWTzf7u5kml+oJm 3Inm8Tg2UFoXkgBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1617629781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=uCmIBk5j6P1YOyqLFJyEv+kBUzlXjBUi7th84ZIJAmQ=; b=ikyRQR2doS4MPp3osxVVaINemGjqrLfmJ1ntrNVAybk3vmue/r0fKjAykfW2Ywe5y7d4lk 4++pCDlyhArWIO19ypJc9vK70OPxJP0X3XuTxHVlOAJggif7fLWIFKVp0DgXr+OpOpdPXt DL3AmJ8l8LnpAnFIRsmQczhSaJuvF1AginpsI7ZFqs3r5aOA230ZRfCdZkH4PYIgtTgVxO 4m7uc8r/PN4/NjEyeCIQZ/93g9Ul5u1hdyXa7JcM7dPkHkX7mKgEAjkxWPwa9lVQKzzkiL k4GDP8HnqYECDSYPH3wP0UnhV3Q+7D50FfhGJLuKz69qoClP37OkGGwBcDvMEA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] logs.cgi/showrequestfromcountry.dat: Proper lookup country code. Date: Mon, 5 Apr 2021 15:36:12 +0200 Message-Id: <20210405133612.3251-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Seems to be a code fragment has been left while switching to libloc. Now call the right function from location-functions.pl. Fixes #12599. Signed-off-by: Stefan Schantl Reviewed-by: Peter Müller --- 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 2a246ec60..f81994f87 100644 --- a/html/cgi-bin/logs.cgi/showrequestfromcountry.dat +++ b/html/cgi-bin/logs.cgi/showrequestfromcountry.dat @@ -218,7 +218,7 @@ if ($multifile) { # extract ipv4 and ipv6 address elsif (($_ =~ /SRC\=(([\d]{1,3})(\.([\d]{1,3})){3})/) or ($_ =~ /SRC\=(([0-9a-fA-F]{0,4})(\:([0-9a-fA-F]{0,4})){2,7})/)) { my $srcaddr=$1; - my $ccode = $gi->country_code_by_name($srcaddr); + my $ccode = &Location::Functions::lookup_country_code($srcaddr); if($ccode eq uc($country)){ # or srcaddr matches country code $log[$lines] = $_;