Skip to content

Conversation

@boquan-fang
Copy link
Contributor

Release Summary:

Allow users to configure only_v6 settings through a new Tokio IO API.

Resolved issues:

resolves #2316

Description of changes:

  • Add a new attribute only_v6 in the Tokio builder and a with_only_v6() method to configure it.
  • Allow users to pass in only_v6 parameter into syscall::bind_udp(), so that the value will be passed top down.
    • Our syscall::udp_socket() function calls .set_only_v6() to configure if the socket should only communicate in IPV6 or not.
  • Refactor the codebase to reflect that parameter change.

Call-outs:

  • The default for only_v6 is false, since the default value for boolean is false. The default is not changed.
    • xdp.rs also calls for udp_socket() and I set the only_v6 to false. We shouldn't change that behavior.
  • The unit test for this change will be ran on UNIX system, since Windows handled sockets's only_v6 attribute very differently.

Testing:

  • Add a unit test to test the parameter change for syscall::bind_udp(). We should verify if the resultant socket has only_v6 set up as expected.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@boquan-fang boquan-fang marked this pull request as ready for review February 13, 2025 22:57
@boquan-fang boquan-fang requested a review from camshaft February 13, 2025 22:57
Boquan Fang added 2 commits February 17, 2025 20:53
* Add documentation to with_only_v6 method
* Adding comments to test only_v6
@boquan-fang boquan-fang requested a review from camshaft February 18, 2025 22:38
@camshaft camshaft enabled auto-merge (squash) February 18, 2025 23:32
@camshaft camshaft merged commit 5e553f3 into aws:main Feb 18, 2025
119 checks passed
@boquan-fang boquan-fang deleted the socket-binds branch February 19, 2025 00:11
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.

Socket always binds to IPv4

2 participants