Skip to content

fix(client): respect local address family when happy eyeballs is disabled - #346

Open
akasakariko wants to merge 1 commit into
hyperium:masterfrom
akasakariko:fix/local-address-ip-version
Open

akasakariko wants to merge 1 commit into
hyperium:masterfrom
akasakariko:fix/local-address-ip-version

Conversation

@akasakariko

Copy link
Copy Markdown

Fixes hyperium/hyper#4258

HttpConnector::set_local_address documents that all sockets are bound to the configured address, but with set_happy_eyeballs_timeout(None) remote addresses of the other IP version were still attempted. ConnectingTcp::new only filtered addresses through split_by_preference when happy eyeballs was enabled, so bind_local_address silently skipped the bind for a mismatched family and the connection went out unbound

This applies the same family filter when happy eyeballs is disabled, dropping remote addresses that cannot be reached from the configured local address

Reproduction: with a connector bound to ::1 and happy eyeballs disabled, connecting to 127.0.0.1 succeeded before this change and now fails without attempting the incompatible address

Verification

  • cargo test --all-features: all tests pass, including the new regression test

  • cargo fmt --all --check: clean

  • The new regression test fails on master and passes with this change

  • The description, docs, and comments (words meant for humans) are written by a human, not by an LLM.

This branch has not been deployed

No deployments
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.

[hyper-util] HttpConnector::set_local_address interacts weirdly with HttpConnector::set_happy_eyeballs_timeout

1 participant