-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Description
Brief description
Copying a FieldContainer instance yields a copy of the contained field instead of the container itself.
This is relevant in cases where a class uses the "field copy" feature in its fields_desc
, e.g.:
class A(Packet):
fields_desc = [ Emph(ByteField("foo", 0)) ]
class B(Packet):
fields_desc = [ A, ByteField("bar", 0) ]
In this situation, B's foo
field should be of type Emph
, but it actually is a plain ByteField
.
Scapy version
Python version
3.13.1
Operating system
Linux 6.12.11-200.fc41.x86_64
Additional environment information
No response
How to reproduce
Emph(ByteField("foo", 0)).copy()
Actual result
<ByteField ().foo>
Expected result
# output should be similar to that of
Emph(ByteField("foo", 0))
<scapy.fields.Emph at 0xdeadbeef>
Related resources
No response
Metadata
Metadata
Assignees
Labels
No labels