Update chunk header/type/shutdown to RFC 9260#427
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #427 +/- ##
==========================================
- Coverage 83.84% 83.78% -0.07%
==========================================
Files 51 51
Lines 3448 3466 +18
==========================================
+ Hits 2891 2904 +13
- Misses 417 419 +2
- Partials 140 143 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes incorrect chunk type constant mappings and enhances SCTP implementation with improved RFC 9260 compliance. The changes address a bug where ctCWR was incorrectly labeled as "ECNE" and adds missing chunk types.
Key changes:
- Fixed bug where
ctCWRreturned "ECNE" instead of "CWR" and added missingctECNEconstant - Added missing
ctAuthchunk type (RFC 4895) - Enhanced chunk header unmarshalling with stricter RFC 9260 validation
- Added comprehensive test coverage for chunk header parsing edge cases
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| chunktype.go | Fixed ctCWR/ECNE bug, added ctECNE and ctAuth constants, updated documentation to reference RFC 9260 |
| chunktype_test.go | Added test cases for ECNE and AUTH chunk types to verify String() output |
| chunkheader.go | Refactored unmarshal logic with improved padding validation and added length validation |
| chunkheader_test.go | Added comprehensive tests for header parsing, padding validation, and edge cases |
| chunk_shutdown.go | Added flags validation, length validation, and improved RFC 9260 compliance |
| chunk_shutdown_test.go | Added explanatory comments and removed invalid test case |
| chunk_shutdown_ack.go | Added value length validation and improved documentation |
| chunk_shutdown_ack_test.go | Added test names and removed invalid test case |
| chunk_shutdown_complete.go | Added value length validation, improved error message, and documentation |
| chunk_shutdown_complete_test.go | Added test names and flag test case |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4b3a517 to
a238f5e
Compare
Description
Reference issue
Part of #426.