Skip to content

Fix IPv6 address handling in LAN <-> WAN join flooder #22226

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tkren
Copy link

@tkren tkren commented Mar 14, 2025

When advertise_addr is an IPv6 address, Consul WAN federation breaks and we get a constant stream of warnings:

[WARN]  agent.server.memberlist.wan: memberlist: Failed to resolve
i-02a3c94b46768b01f.aws-eu-west-1/2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302:
lookup 2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302: no such host

The LAN <-> WAN join flooder creates IPv6 addresses without square brackets with fmt.Sprintf("%s:%d", addr, s.WanJoinPort), which confuses net.SplitHostPort in memberlist.resolveAddr.

Fixes #22225

When `advertise_addr` is an IPv6 address, Consul WAN federation breaks
and we get a constant stream of warnings:
```
[WARN]  agent.server.memberlist.wan: memberlist: Failed to resolve
i-02a3c94b46768b01f.aws-eu-west-1/2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302:
lookup 2a05:d018:18a3:f202:64d9:1621:ab22:df45:8302: no such host
```

The LAN <-> WAN join flooder creates IPv6 addresses without square
brackets with `fmt.Sprintf("%s:%d", addr, s.WanJoinPort)`, which
confuses `net.SplitHostPort` in `memberlist.resolveAddr`.

Fixes hashicorp#22225
@tkren tkren requested a review from a team as a code owner March 14, 2025 23:34
Copy link

hashicorp-cla-app bot commented Mar 14, 2025

CLA assistant check
All committers have signed the CLA.

@cfunkhouser
Copy link

It would be great to get this fix in, or at least get some feedback on the state of #22225. Can anyone comment on how fixes are being prioritized?

Copy link
Member

@sreeram77 sreeram77 left a comment

Choose a reason for hiding this comment

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

Please add a changelog as per this doc

@srahul3 srahul3 added the backport/1.21 Changes are backported to 1.21 label Apr 29, 2025
@tkren tkren requested a review from sreeram77 April 29, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.21 Changes are backported to 1.21
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IPv6 address handling broken in LAN <-> WAN join flooder
4 participants