Skip to content

raw: optional IP version and next_header #1067

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

Merged

Conversation

KingCol13
Copy link
Contributor

Fixes #1064

Makes ip_version and ip_protocol fields of RawSocket into options, when None the socket will not check this field when sending or receiving.

Copy link

codecov bot commented Jun 24, 2025

Codecov Report

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

Project coverage is 81.16%. Comparing base (e2b75e3) to head (9779059).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/socket/raw.rs 93.02% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1067      +/-   ##
==========================================
- Coverage   81.17%   81.16%   -0.01%     
==========================================
  Files          81       81              
  Lines       28955    28974      +19     
==========================================
+ Hits        23503    23516      +13     
- Misses       5452     5458       +6     

☔ 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.

@whitequark
Copy link
Contributor

I have two concerns.

  1. This is a breaking change. @Dirbaio, do we just increment the minor? I'm not sure what the current policy is.
  2. Should these be two individual options, or one option with a tuple of (IpVersion, IpProtocol)?

@KingCol13
Copy link
Contributor Author

KingCol13 commented Jun 25, 2025

1. This is a breaking change. @Dirbaio, do we just increment the minor? I'm not sure what the current policy is.

Following Rust's modified semantic versioning we'd bump to 0.13.0. I don't know if that should be done in this PR or just before release though. Let me know if you want me to add to the changelog.

2. Should these be two individual options, or one option with a tuple of (IpVersion, IpProtocol)?

Two options gives users more flexibility, e.g. if I want to accept all Ipv4 packets without filtering on the protocol.

@whitequark
Copy link
Contributor

Two options gives users more flexibility, e.g. if I want to accept all Ipv4 packets without filtering on the protocol.

Yes, good point. I'm fine with two options.

I haven't done release engineering on smoltcp in a while so I think we can just merge this, noting that the next release should be a minor bump.

@whitequark whitequark added this pull request to the merge queue Jun 26, 2025
Merged via the queue into smoltcp-rs:main with commit e000f15 Jun 26, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Remove IP version and next header checks for raw sockets
2 participants