Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix SCTP decoder DATA chunk padding and handling of .data field #509

Merged
merged 5 commits into from
Dec 27, 2020

Conversation

obormot
Copy link
Collaborator

@obormot obormot commented Dec 27, 2020

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.

@obormot obormot changed the title Fix #499 fix SCTP decoder DATA chunk padding and handling of .data field Dec 27, 2020
@coveralls
Copy link

coveralls commented Dec 27, 2020

Coverage Status

Coverage increased (+0.008%) to 92.47% when pulling 0803479 on fix-#499 into 4ce0b89 on master.

Copy link
Collaborator

@brifordwylie brifordwylie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@obormot obormot merged commit 74872b0 into master Dec 27, 2020
@obormot obormot deleted the fix-#499 branch December 27, 2020 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with SCTP DATA chunk padding
3 participants