This fixes #499 and adds a unit test based on a pcap I found among Wireshark sample captures.
While working on the fix I noticed SCTP decoder incorrectly uses its .data field, basically copying .chunks as seen in this line:
self.data = self.chunks = l
All other dpkt decoders utilize the .data for any bytes remaining after decoding all the known fields (header fields and .chunks in this case), leaving it for other decoders to pick up if necessary. I changed the sctp decoder to align with this convention and use .chunks instead of .data when packing and unpacking. All existing unit tests pass without changes.
Coverage increased (+0.008%) to 92.47% when pulling 0803479b7f1e2381e4ee8b8f95c6b02b323308a8 on fix-#499 into 4ce0b897e60a67fec4b590af058fd702563d79c5 on master.
This fixes #499 and adds a unit test based on a pcap I found among Wireshark sample captures.
While working on the fix I noticed SCTP decoder incorrectly uses its
.data
field, basically copying.chunks
as seen in this line:All other dpkt decoders utilize the
.data
for any bytes remaining after decoding all the known fields (header fields and.chunks
in this case), leaving it for other decoders to pick up if necessary. I changed the sctp decoder to align with this convention and use.chunks
instead of.data
when packing and unpacking. All existing unit tests pass without changes.