Skip to content

Update error_cause to RFC 9260 - #425

Merged
JoTurk merged 1 commit into
mainfrom
pch07/update-error-cause-9260
Oct 1, 2026
Merged

JoTurk merged 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 84.21053% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.41%. Comparing base (a5a8fe0) to head (ed09464).

Files with missing lines Patch % Lines
error_cause.go 70.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #425      +/-   ##
==========================================
- Coverage   89.47%   89.41%   -0.06%     
==========================================
  Files          56       56              
  Lines        4770     4773       +3     
==========================================
  Hits         4268     4268              
- Misses        502      505       +3     
Flag Coverage Δ
go 89.41% <84.21%> (-0.06%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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 4 times, most recently from deb71f5 to 22bf9a2 Compare October 31, 2025 05:06

@JoTurk JoTurk left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good, but need to drop most of the tests, I'll do that tonight.

@JoTurk
JoTurk force-pushed the pch07/update-error-cause-9260 branch from 22bf9a2 to b9a3f48 Compare October 1, 2026 00:48
@JoTurk

JoTurk commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

simplified this from +307-22 change to +61-31

@JoTurk
JoTurk force-pushed the pch07/update-error-cause-9260 branch from b9a3f48 to ed09464 Compare October 1, 2026 00:51
@JoTurk
JoTurk merged commit 2731906 into main Oct 1, 2026
19 checks passed
@JoTurk
JoTurk deleted the pch07/update-error-cause-9260 branch October 1, 2026 00:53
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

3 participants