Skip to content
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

Add Sctp protocol and MSG_NOTIFICATION #2562

Merged
merged 1 commit into from
Dec 18, 2024
Merged

Conversation

gnaaman-dn
Copy link
Contributor

@gnaaman-dn gnaaman-dn commented Dec 16, 2024

What does this PR do

  • Adds the Sctp variant to the SockProtocol enum, allowing the user to create SCTP sockets with either SockType::Stream or SockType::SeqPacket.
  • (Linux Only) Expose MSG_NOTIFICATION through MsgFlags so that it won't be truncated when converting from i32.

IPPROTO_SCTP is defined in RFC-6458, but it is not supported by all OSs.
I've cfg'd-out targets that failed in CI.

MSG_NOTIFICATION is Linux-specific, as far as I can tell, but is not exposed through Android's libc, so I've limited it to linux and not linux_android.

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API

@gnaaman-dn gnaaman-dn force-pushed the master branch 5 times, most recently from 4564793 to 1bf179e Compare December 16, 2024 16:01
@SteveLauC SteveLauC self-requested a review December 17, 2024 09:51
Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, just 2 cfg nits:)

src/sys/socket/mod.rs Outdated Show resolved Hide resolved
src/sys/socket/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

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

Thanks!

@SteveLauC SteveLauC added this pull request to the merge queue Dec 18, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 18, 2024
@SteveLauC SteveLauC added this pull request to the merge queue Dec 18, 2024
Merged via the queue into nix-rust:master with commit 5ef78a8 Dec 18, 2024
40 checks passed
@gnaaman-dn
Copy link
Contributor Author

Thank you @SteveLauC !

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.

2 participants