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

quinn: Make Endpoint::client dual-stack V6 by default #1913

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

gretchenfrage
Copy link
Contributor

Following a conversation in the crate discord [link] in which @Ralith mentioned:

maybe Endpoint::client should do this by default? I suspect real applications inevitably need to use a lower level constructor, but it's one less footgun

This PR makes makes quinn::Endpoint::client use socket2 to automatically try to set IPV6_V6ONLY to false if binding to a V6 address. Modifies the documentation to match. If the call to set_only_v6 errors, it logs the error as a warning, but proceeds with the rest of the client method anyways.

Removes the OS-based gating from quinn's tests::echo_dualstack test. Unfortunately(?), that tests seems to work on main for me anyways on my current system, so I'm leaning on the CI to make sure that there's not some common system where dual-stack conversion is always impossible.

@gretchenfrage gretchenfrage force-pushed the client-dual-stack-default branch 2 times, most recently from 927fb01 to a98c0c7 Compare July 2, 2024 05:12
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

Thanks, I think this makes sense.

quinn/src/endpoint.rs Outdated Show resolved Hide resolved
quinn/src/endpoint.rs Outdated Show resolved Hide resolved
@gretchenfrage gretchenfrage marked this pull request as ready for review July 3, 2024 00:05
@gretchenfrage gretchenfrage requested a review from Ralith July 3, 2024 00:05
Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

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

Thanks!

Cargo.toml Outdated Show resolved Hide resolved
quinn/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

Thanks!

@Ralith Ralith merged commit 693c9b7 into quinn-rs:main Jul 4, 2024
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.

3 participants