Skip to content

Commit 000e16b

Browse files
Copy the no_cache flag in Packet._fast_copy() (#4705)
1 parent 9c26a32 commit 000e16b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scapy/packet.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,10 @@ def _fast_copy_fields_dict(
528528
clone.fields = _fast_copy_fields_dict(self.fields)
529529
clone.explicit = self.explicit
530530

531+
# Copy the `no_cache` flag if set on the source packet, and not already set on the clone.
532+
if self.no_cache and (not clone.no_cache):
533+
clone.no_cache = True
534+
531535
# Both `copy()` and `clone_with()` set the `default_fields` attribute with the `copy_fields_dict()` method.
532536
#
533537
# Memo:

0 commit comments

Comments
 (0)