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
2f3f5dd
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
Expected result
# output should be similar to that of
Emph(ByteField("foo", 0))
<scapy.fields.Emph at 0xdeadbeef>
Related resources
No response
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.:In this situation, B's
foofield should be of typeEmph, but it actually is a plainByteField.Scapy version
2f3f5dd
Python version
3.13.1
Operating system
Linux 6.12.11-200.fc41.x86_64
Additional environment information
No response
How to reproduce
Actual result
Expected result
Related resources
No response