From a5a1b6ed6d20b1e2b1b1eb146a9ba6470536d016 Mon Sep 17 00:00:00 2001 From: 4hiziri Date: Sat, 18 Nov 2017 10:30:57 +0900 Subject: [PATCH] Fix regex pattern of IPv6 address. Previous pattern doesn't match fe80::1/64, but this pattern is valid. So I add new pattern for subnet and this matches fe80::1/64. --- scapy/layers/inet6.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scapy/layers/inet6.py b/scapy/layers/inet6.py index f1be392..f09dfa4 100644 --- a/scapy/layers/inet6.py +++ b/scapy/layers/inet6.py @@ -131,7 +131,7 @@ def getmacbyip6(ip6, chainCC=0): class Net6(Gen): # syntax ex. fec0::/126 """Generate a list of IPv6s from a network address or a name""" name = "ipv6" - ipaddress = re.compile(r"^([a-fA-F0-9:]+)(/[1]?[0-3]?[0-9])?$") + ipaddress = re.compile(r"^([a-fA-F0-9:]+)(/([1]?[0-3]?[0-9]|[0-9]?[0-9]))?$") def __init__(self, net): self.repr = net