Skip to content

Commit 10476dc

Browse files
committed
Merged in p-l/scapy (pull request phaethon#131)
Fix IPv6 random addresses (thanks Guillaume Valadon!)
2 parents d8671fb + 8986cc3 commit 10476dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scapy/volatile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def _fix(self):
294294
remain = random.randint(0,remain)
295295
for j in range(remain):
296296
ip.append("%04x" % random.randint(0,65535))
297-
if n == 0:
297+
elif n == 0:
298298
ip.append("0")
299299
elif not n:
300300
ip.append("")
@@ -303,7 +303,7 @@ def _fix(self):
303303
if len(ip) == 9:
304304
ip.remove("")
305305
if ip[-1] == "":
306-
ip[-1] = 0
306+
ip[-1] = "0"
307307
return ":".join(ip)
308308

309309
class RandOID(RandString):

0 commit comments

Comments
 (0)