From bd1c8ba0d451291abedf4f8246f4bdbee2da8713 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 19 Sep 2020 13:46:19 +0800 Subject: [PATCH] dns-reverse-generator.py: cannot take ipv6 --- scripts/dns-reverse-generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dns-reverse-generator.py b/scripts/dns-reverse-generator.py index d7aa65e..aa4e23e 100755 --- a/scripts/dns-reverse-generator.py +++ b/scripts/dns-reverse-generator.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 import sys -from ipaddress import IPv4Address, ip_network +from ipaddress import IPv4Address, ip_network, IPv4Network from pathlib import Path import toml @@ -16,7 +16,7 @@ def iter_route(route_type: str): items.extend( (entity["name"], ip_network(route).network_address) for route, entity in routes.items() - if entity["type"] == route_type + if entity["type"] == route_type and isinstance(ip_network(route), IPv4Network) ) return sorted(items, key=lambda item: item[1])