From 67db066a99940a6f31a4271659d085e7bde4743a Mon Sep 17 00:00:00 2001 From: Guillaume Valadon Date: Wed, 24 Jul 2013 16:53:10 +0200 Subject: [PATCH] Issue #588: RandIP6() returns an invalid IPv6 address when zeros are present in template --- scapy/volatile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scapy/volatile.py b/scapy/volatile.py index dcb704c1c..f7dcfbc08 100644 --- a/scapy/volatile.py +++ b/scapy/volatile.py @@ -283,6 +283,8 @@ class RandIP6(RandString): remain = random.randint(0,remain) for j in range(remain): ip.append("%04x" % random.randint(0,65535)) + if n == 0: + ip.append("0") elif not n: ip.append("") else: