-
Notifications
You must be signed in to change notification settings - Fork 36
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
dns fanout: wrap IPv6 address #1374
dns fanout: wrap IPv6 address #1374
Conversation
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
@@ -55,6 +56,11 @@ func (h *fanoutHandler) ServeDNS(ctx context.Context, rw dns.ResponseWriter, msg | |||
Timeout: timeout, | |||
} | |||
|
|||
// If u.Host is IPv6 then wrap it in brackets | |||
if strings.Count(u.Host, ":") >= 2 && !strings.HasPrefix(u.Host, "[") && !strings.Contains(u.Host, "]") { | |||
u.Host = fmt.Sprintf("[%s]", u.Host) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we apply this foraddress
variable from line 64?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately no. We need line 65.
url.Port()
validates the value when calculating the port. And it looks at brackets.
So we need to modify u.Host
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k@main PR link: networkservicemesh/sdk#1374 Commit: fa94b07 Author: Artem Glazychev Date: 2022-12-15 16:54:44 +0700 Message: - dns fanout: wrap IPv6 address (#1374) Signed-off-by: Artem Glazychev <artem.glazychev@xored.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
Signed-off-by: Artem Glazychev artem.glazychev@xored.com
Description
Issue link
networkservicemesh/integration-k8s-aws#324
How Has This Been Tested?
Types of changes