Skip to content

Update error_cause to RFC 9260 - #425

Open
philipch07 wants to merge 1 commit into
mainfrom
pch07/update-error-cause-9260
Open

Update error_cause to RFC 9260#425
philipch07 wants to merge 1 commit into
mainfrom
pch07/update-error-cause-9260

Conversation

@philipch07

Copy link
Copy Markdown
Member

Description

  • Updated error_cause.go to have updated errors according to RFC 9260
  • Added an error for other causes if the length is too short
  • Added references to RFC 9260 where applicable

Reference issue

Resolves #424.

@codecov

codecov Bot commented Oct 31, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.94737% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.57%. Comparing base (a69c6a2) to head (22bf9a2).
⚠️ Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
error_cause.go 88.88% 0 Missing and 1 partial ⚠️
error_cause_protocol_violation.go 50.00% 0 Missing and 1 partial ⚠️
error_cause_unrecognized_chunk_type.go 0.00% 0 Missing and 1 partial ⚠️
error_cause_user_initiated_abort.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #425      +/-   ##
==========================================
+ Coverage   83.84%   84.57%   +0.72%     
==========================================
  Files          51       51              
  Lines        3448     3455       +7     
==========================================
+ Hits         2891     2922      +31     
+ Misses        417      394      -23     
+ Partials      140      139       -1     
Flag Coverage Δ
go 84.57% <78.94%> (+0.72%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JoTurk
JoTurk requested a review from Copilot October 31, 2025 03:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances error cause handling in the SCTP implementation by adding validation for error cause lengths and improving code consistency. The changes ensure that error causes comply with RFC 9260 specifications regarding the 16-bit length field constraints.

  • Adds length validation to prevent oversized error cause values that would overflow the 16-bit length field
  • Refactors error handling to use inline variable declarations for cleaner code
  • Updates documentation and error messages for clarity and RFC 9260 compliance

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
error_cause.go Adds pre-validation in buildErrorCause(), introduces new error constants, updates error messages, and fixes String() method capitalization
error_cause_header.go Adds length validation in marshal(), adds input validation in unmarshal(), improves inline comments, and defines maxErrorCauseValueLen constant
error_cause_user_initiated_abort.go Adds length validation in marshal() using new constant, refactors unmarshal error handling, fixes comment spacing
error_cause_protocol_violation.go Adds length validation in marshal() using new constant, refactors unmarshal error handling, updates documentation formatting
error_cause_unrecognized_chunk_type.go Refactors unmarshal error handling to inline variable declaration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread error_cause_user_initiated_abort.go Outdated
Comment thread error_cause_protocol_violation.go Outdated
@philipch07
philipch07 force-pushed the pch07/update-error-cause-9260 branch 3 times, most recently from 237602d to deb71f5 Compare October 31, 2025 05:04
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.

Update error_cause files to RFC 9260

2 participants