From patchwork Sun Jun 20 10:43:07 2021 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: 4445 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 4G78QD1SdBz3wbS for ; Sun, 20 Jun 2021 10:43:16 +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 4G78QC5lJQzqx; Sun, 20 Jun 2021 10:43:15 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4G78QC488Bz2xff; Sun, 20 Jun 2021 10:43:15 +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 4G78Q96C4Hz2xBf for ; Sun, 20 Jun 2021 10:43:13 +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 4G78Q81S6lzqx for ; Sun, 20 Jun 2021 10:43:11 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1624185793; 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=GP2go13UiTTw4dVDGSP4hLGYJTmX7hFu+/NQLObFqjc=; b=/rlLOvWnCmVP1nVQzESksNYR/uaB8eZD7xKYX8N6MPPHT1Ln0dYpI6nplGNnzCL309/6oH Ghf0YfuCU7NRvhBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1624185793; 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=GP2go13UiTTw4dVDGSP4hLGYJTmX7hFu+/NQLObFqjc=; b=YxcSv4CK/7wtUSkYBnPLhmT0dNj2RthdIfS4sXzIbHRlnnMPzifexNXK17Kcm+5lNa70vS HszT0jY7m2eULaUGx0ikvB7griy0+1StxPNbYE7smPsWhypbDIpzwn398FixS7SbYmB0BJ u0hFHq3Ghe1iJVmsxYBfgupXc0GOh0xlyS+tYz4Ttm9n3LtFgDTzytUMMwPktGOXbE+Tnk JnJ6DKOYMSH87N31k6M3bsbldFXhAxKzeKAldngSBNQMAT+68/U6aGxDpmDYyCpog3wzO3 Ft+ph0WlMxx+GmP02wqIY7ccRJhBuDR1hYsML9KMVEOgvZBVSf1zjWaS1eM70Q== To: "IPFire: Location" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH] location-import.in: optimise regular expression for filtering ASN allocations to other RIRs when parsing ARIN AS names file Message-ID: <234e5464-f24f-9725-2cdc-0b0f4173e7c1@ipfire.org> Date: Sun, 20 Jun 2021 12:43:07 +0200 MIME-Version: 1.0 Content-Language: en-US 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" https://lists.ipfire.org/pipermail/location/2021-June/000394.html Reported-by: Michael Tremer Signed-off-by: Peter Müller --- src/python/location-importer.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/location-importer.in b/src/python/location-importer.in index b235db7..ff90d91 100644 --- a/src/python/location-importer.in +++ b/src/python/location-importer.in @@ -811,7 +811,7 @@ class CLI(object): continue # Skip any AS name that appears to be a placeholder for a different RIR or entity... - if re.match(r"^(ASN-BLK|)(AFCONC|AFRINIC|APNIC|ASNBLK|DNIC|LACNIC|RIPE|IANA)(\d?$|\-.*)", name): + if re.match(r"^(ASN-BLK|)(AFCONC|AFRINIC|APNIC|ASNBLK|DNIC|LACNIC|RIPE|IANA)(?:\d?$|\-)", name): continue # Bail out in case the AS name contains anything we do not expect here...