From 478f7a8911e6b19ade43e6bca9d1905a82f56ea1 Mon Sep 17 00:00:00 2001 From: firefart <105281+firefart@users.noreply.github.com> Date: Sat, 19 Aug 2023 15:57:45 +0200 Subject: [PATCH] inetnum --- create_db.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/create_db.py b/create_db.py index a44e38d..d2dab0f 100755 --- a/create_db.py +++ b/create_db.py @@ -78,14 +78,13 @@ def parse_property_inetnum(block: str) -> str: ip_end = match[0][1].decode('utf-8') cidrs = iprange_to_cidrs(ip_start, ip_end) return cidrs - # IPv6 - match = re.findall( - rb'^inet6num:[\s]*([0-9a-fA-F:\/]{1,43})', block, re.MULTILINE) + # direct CIDR in lacnic db + match = re.findall(rb'^inetnum:[\s]*((?:\d{1,3}\.){3}\d{1,3}/\d+)', block, re.MULTILINE) if match: return match[0] - # LACNIC translation for IPv4 + # IPv6 match = re.findall( - rb'^inet4num:[\s]*((?:\d{1,3}\.){3}\d{1,3}/\d{1,2})', block, re.MULTILINE) + rb'^inet6num:[\s]*([0-9a-fA-F:\/]{1,43})', block, re.MULTILINE) if match: return match[0] # ARIN route IPv4