Skip to content

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

Merged
seanmonstar merged 1 commit into
hyperium:masterfrom
akasakariko:fix/local-address-ip-version
Nov 17, 2026
Merged

seanmonstar merged 1 commit into
hyperium:masterfrom
akasakariko:fix/local-address-ip-version

Conversation

@akasakariko

Copy link
Copy Markdown
Contributor

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.

@seanmonstar seanmonstar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@seanmonstar
seanmonstar merged commit 5f4e90e into hyperium:master Nov 17, 2026
20 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.

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

2 participants