diff --git a/scapy/contrib/enipTCP.py b/scapy/contrib/enipTCP.py index e35d2e27f67..c79bf044d7f 100644 --- a/scapy/contrib/enipTCP.py +++ b/scapy/contrib/enipTCP.py @@ -139,12 +139,24 @@ class ENIPUnknownCommand(Packet): # List services (0x0004) -class ENIPListServicesItem(Packet): +class _ENIPListItem(Packet): + """Item whose itemLength counts every byte after the length field""" + + def post_build(self, pkt, pay): + if self.itemLength is None: + pkt = pkt[:2] + struct.pack("