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

Give a valid service address in SRV lookup when it differs from the node's #2446

Merged
merged 4 commits into from
Oct 28, 2016

Conversation

kyhavlov
Copy link
Contributor

@kyhavlov kyhavlov commented Oct 28, 2016

Fixes #832

Still need to add a 'TestDNS_ServiceLookup_ServiceAddressIPv6' test, I think that's the only thing missing here.

@@ -357,6 +358,46 @@ PARSE:
query := strings.Join(labels[:n-1], ".")
d.preparedQueryLookup(network, datacenter, query, req, resp)

case "addr":
if n < 2 {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be != 2 so we don't accept any periods, since we know it's just hex stuff.

@slackpad
Copy link
Contributor

LGTM - one tiny thing and then the IPv6 test and this should be gtg!

if !ok {
t.Fatalf("Bad: %#v", in.Extra[0])
}
if aRec.Hdr.Name != "2607002040050808000000000000200e.addr.dc1.consul." {
Copy link
Contributor

Choose a reason for hiding this comment

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

lol these hex names are 1337

@kyhavlov
Copy link
Contributor Author

kyhavlov commented Oct 28, 2016

Addressed the comment and added a couple tests for lookups on 'addr.consul'

@kyhavlov kyhavlov merged commit 63534ac into master Oct 28, 2016
@kyhavlov kyhavlov deleted the b-srv-lookup-external branch October 28, 2016 04:04
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.

2 participants