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

SRV backend IPv6 support #222

Merged
merged 3 commits into from
Jan 22, 2020
Merged

SRV backend IPv6 support #222

merged 3 commits into from
Jan 22, 2020

Conversation

erincandescent
Copy link
Contributor

The current backend SRV only looks for A records / IPv4 addresses. I wish to use gobetween as the L4 ingress on a Kubernetes cluster where the internal network is IPv6 only

This change:

  • Extracts AAAA records from the additional section of the SRV lookup, and
  • Performs queries for AAAA records if no IP is found and if an A lookup returns nothing

* Extract AAAAs from additional data
* Query for AAAAs if not present and we don't find an A
case *dns.A:
hosts[record.Header().Name] = record.A.String()
case *dns.AAAA:
hosts[record.Header().Name] = fmt.Sprintf("[%s]", record.AAAA.String())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is slightly annoying - Gobetween uses net.Dial("tcp", addr) which requires bracketed IPv6s. If storing IPs here, it would be better to store them as net.IPs.

@yyyar yyyar requested a review from illarion June 16, 2019 10:45
@yyyar yyyar added this to the 0.8.0 milestone Jun 16, 2019
@yyyar yyyar added the feature label Jun 16, 2019
@yyyar yyyar merged commit d50b60f into yyyar:master Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants