From patchwork Tue Mar 1 21:52:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 5296 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 4K7WFc3wQbz3wtR for ; Tue, 1 Mar 2022 21:52:52 +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 4K7WFb5QLLz3gc; Tue, 1 Mar 2022 21:52:51 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4K7WFb43Mmz2xR5; Tue, 1 Mar 2022 21:52:51 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4K7WFZ155Lz2xPS for ; Tue, 1 Mar 2022 21:52:50 +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 4K7WFX4GRjz1NM for ; Tue, 1 Mar 2022 21:52:48 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1646171569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aHlk8P3jWM01tAD+ZD8f624WinF4q6jkIUwGAWnhhRI=; b=y9ehLMAnh87u8E57/cT6z/zPAZCH1g83A8nzjpNbd+1CQneF5lNqFxHGBpsNUEkucrvbBA DnqN/KW8EbJTozDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1646171569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aHlk8P3jWM01tAD+ZD8f624WinF4q6jkIUwGAWnhhRI=; b=snW0eEmDPXAhK4pf3qaKDY3oaAtasXGtT9T1HTU8gDTQqla199UVfeZs7qnLYm2ERx2FMm Rct4zYaFpL2ztLie5VcSR0+j05x1m6mRJdzdY7iy1qomM2zKovkP5rTxF8XZtPwgJxq9u/ KPqmfU8RZSARup+ENPAmhvDq9Y/H4a7Gl7TKD+T0AYgpaHD60o0lUSW1xgGqXAF7tGwity BzIU8ULCpfbV3VDnDL1ISX93BUYPle8noWwBsFnPlQAi+7IPCIv1sINyx58u1vpttE5b6v e9W1IK1sCN2uIAhXqlktTUhIqZmDhN34DO4C7jwECyIOv4KUKXiD6Auu3hBZJw== Message-ID: <5e2c3c46-f8e5-8b2a-45bf-04c925f65f73@ipfire.org> Date: Tue, 1 Mar 2022 21:52:39 +0000 MIME-Version: 1.0 Content-Language: en-US To: "IPFire: Location" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH] location-importer: Fix parsing LACNIC-flavoured inetnums X-BeenThere: location@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: location-bounces@lists.ipfire.org Sender: "Location" My fault, again. :-/ Reported-by: Michael Tremer Signed-off-by: Peter Müller --- src/python/location-importer.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python/location-importer.in b/src/python/location-importer.in index 83fb5c7..fe13482 100644 --- a/src/python/location-importer.in +++ b/src/python/location-importer.in @@ -3,7 +3,7 @@ # # # libloc - A library to determine the location of someone on the Internet # # # -# Copyright (C) 2020-2021 IPFire Development Team # +# Copyright (C) 2020-2022 IPFire Development Team # # # # This library is free software; you can redistribute it and/or # # modify it under the terms of the GNU Lesser General Public # @@ -691,9 +691,9 @@ class CLI(object): # How many octets do we need to add? # (LACNIC does not seem to have a /8 or greater assigned, so the following should suffice.) - if ldigits == 2: + if ldigits == 1: start_address = start_address[0] + ".0.0/" + start_address[1] - elif ldigits == 3: + elif ldigits == 2: start_address = start_address[0] + ".0/" + start_address[1] else: log.warning("Could not recover IPv4 address from line in LACNIC DB format: %s" % line)