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

Unmarshal packets only once #304

Merged
merged 1 commit into from
Feb 28, 2024
Merged

Unmarshal packets only once #304

merged 1 commit into from
Feb 28, 2024

Conversation

tuexen
Copy link
Contributor

@tuexen tuexen commented Feb 28, 2024

Unmarshal of a packet should only be done once, since doing it multiple times ends up in an incorrect list of chunks. Also, perform checksum validation first.

For pion, the only chunks requiring a correct CRC32c are the INIT and COOKIE-ECHO chunks, which need to be the first chunk in a packet (as long as the stack does not support SCTP AUTH).

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 80.81%. Comparing base (8cfa15d) to head (ec1e619).

Files Patch % Lines
packet.go 81.25% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
+ Coverage   80.71%   80.81%   +0.09%     
==========================================
  Files          49       49              
  Lines        4133     4133              
==========================================
+ Hits         3336     3340       +4     
+ Misses        652      649       -3     
+ Partials      145      144       -1     
Flag Coverage Δ
go 80.81% <82.35%> (+0.09%) ⬆️
wasm 67.19% <76.47%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Unmarshal of a packet should only be done once, since doing
it multiple times ends up in an incorrect list of chunks.
Also, perform checksum validation first.
For pion, the only chunks requiring a correct CRC32c are the
INIT and COOKIE-ECHO chunks, which need to be the first
chunk in a packet.
@tuexen tuexen requested review from mengelbart, enobufs and edaniels and removed request for enobufs February 28, 2024 11:03
Copy link
Member

@edaniels edaniels left a comment

Choose a reason for hiding this comment

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

@edaniels edaniels merged commit a5583a6 into pion:master Feb 28, 2024
13 checks passed
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.

2 participants