Issue #588: RandIP6() returns an invalid IPv6 address when zeros are present in template

This commit is contained in:
Guillaume Valadon 2013-07-24 16:53:10 +02:00
parent 02ebc34fda
commit 67db066a99
1 changed files with 2 additions and 0 deletions

View File

@ -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: