Skip to content
Snippets Groups Projects
Commit 67db066a authored by Guillaume Valadon's avatar Guillaume Valadon
Browse files

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

parent 02ebc34f
No related branches found
No related tags found
No related merge requests found
...@@ -283,6 +283,8 @@ class RandIP6(RandString): ...@@ -283,6 +283,8 @@ class RandIP6(RandString):
remain = random.randint(0,remain) remain = random.randint(0,remain)
for j in range(remain): for j in range(remain):
ip.append("%04x" % random.randint(0,65535)) ip.append("%04x" % random.randint(0,65535))
if n == 0:
ip.append("0")
elif not n: elif not n:
ip.append("") ip.append("")
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment