This happens quite often when protocols include an integrity field at the end of the packet.
Example of proposal:
class A(Packet):
def extract_padding(self, s):
return b'', s
class B(Packet):
def extract_padding(self, s):
return b'', s
class M(Packet):
fields_desc = [
ByteField("type", default=0),
PayloadField("pld"),
XShortField("crc", default=0),
]
bind_layers(M, A, type=0x0A)
bind_layers(M, B, type=0x0B)
The same as we do for regular payloads.