Skip to content

Conversation

@marco-a-itl
Copy link
Contributor

@marco-a-itl marco-a-itl commented Nov 28, 2025

Add error parameter to subflow_closed callback to allow plugins to identify the reason for subflow closure, such as network errors.

The error value corresponds to the MPTCP_ATTR_ERROR attribute from the kernel, which equals sk_err from struct sock. If the error attribute is not present in the Netlink message, it defaults to 0.

Fixes #330

Changes

  • Updated mptcpd_plugin_ops.subflow_closed signature to include uint8_t error parameter
  • Modified all plugins and tests to use the new signature
  • Added test validation for the error parameter

Add error parameter to subflow_closed callback to allow plugins
to identify the reason for subflow closure, such as network errors.

The error value corresponds to the MPTCP_ATTR_ERROR attribute from
the kernel, which equals sk_err from struct sock. If the error
attribute is not present in the netlink message, it defaults to 0.

Fixes multipath-tcp#330
@coveralls
Copy link

coveralls commented Nov 28, 2025

Pull Request Test Coverage Report for Build 19815302030

Details

  • 1 of 2 (50.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 67.014%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/path_manager.c 0 1 0.0%
Totals Coverage Status
Change from base Build 19644312326: -0.03%
Covered Lines: 1481
Relevant Lines: 2210

💛 - Coveralls

Copy link
Member

@matttbe matttbe left a comment

Choose a reason for hiding this comment

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

Thank you for having looked at that!

I just have two small suggestions if you don't mind.

- Add non-zero test value (110) for test_error_4 to verify different values
- Enhance error parameter documentation to clarify it's an errno from sk_err
- Update both public and private plugin headers with detailed description
@marco-a-itl
Copy link
Contributor Author

Thank you for having looked at that!

I just have two small suggestions if you don't mind.

Thanks for the review, I've addressed both suggestions:

  • Changed test_error_4 to 110 (non-zero value) to test different error values
  • Enhanced the error parameter documentation in both headers to clarify it's an errno from sk_err

Copy link
Member

@matttbe matttbe left a comment

Choose a reason for hiding this comment

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

Thank you for the update! It looks good to me!

@matttbe matttbe merged commit 32524b7 into multipath-tcp:main Dec 1, 2025
8 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.

expose pm_event_attrs->error to plugins when subflow is closed

3 participants