mirror of https://github.com/secdev/scapy.git
Merge pull request #694 from guedou/Issue_#529
Don't call randval() on unused ConditionalField
This commit is contained in:
commit
a8decd0518
|
@ -1463,9 +1463,10 @@ def fuzz(p, _inplace=0):
|
|||
print("fuzzing", repr(r))
|
||||
fuzz(r, _inplace=1)
|
||||
elif f.default is not None:
|
||||
rnd = f.randval()
|
||||
if rnd is not None:
|
||||
q.default_fields[f.name] = rnd
|
||||
if not isinstance(f, ConditionalField) or f._evalcond(q):
|
||||
rnd = f.randval()
|
||||
if rnd is not None:
|
||||
q.default_fields[f.name] = rnd
|
||||
q = q.payload
|
||||
return p
|
||||
|
||||
|
|
|
@ -403,7 +403,7 @@ bind_layers(IP, ICMP, frag=0, proto=1)
|
|||
= fuzz
|
||||
~ not_pypy
|
||||
random.seed(0x2807)
|
||||
str(fuzz(IP()/ICMP())) == '\xe5S\x00\x1c\x9dC \x007\x01(H\x7f\x00\x00\x01\x7f\x00\x00\x01*\xdb\xf7,9\x8e\xa4i'
|
||||
str(fuzz(IP()/ICMP())) == 'u\x14\x00\x1c\xc2\xf6\x80\x00\xde\x01k\xd3\x7f\x00\x00\x01\x7f\x00\x00\x01y\xc9>\xa6\x84\xd8\xc2\xb7'
|
||||
|
||||
= Building some packets
|
||||
~ basic IP TCP UDP NTP LLC SNAP Dot11
|
||||
|
|
Loading…
Reference in New Issue