We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
fuzz()
default_fields
1 parent 23b1628 commit 5a1f68fCopy full SHA for 5a1f68f
scapy/packet.py
@@ -2937,7 +2937,12 @@ def fuzz(p, # type: _P
2937
rnd = fld._find_fld_pkt(q).randval()
2938
if rnd is not None:
2939
new_default_fields[name] = rnd
2940
- q.default_fields.update(new_default_fields)
+ # Avoid messing up the original packet `default_fields` dictionary which is unique for all instances of the given layer.
2941
+ # Build a new dictionary, and update it with `new_default_fields`.
2942
+ q.default_fields = {
2943
+ **q.default_fields,
2944
+ **new_default_fields,
2945
+ }
2946
q = q.payload
2947
2948
# Avoid caching for `p`.
0 commit comments