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

dns fanout: wrap IPv6 address #1374

Merged
merged 1 commit into from
Dec 15, 2022

Conversation

glazychev-art
Copy link
Contributor

@glazychev-art glazychev-art commented Nov 7, 2022

Signed-off-by: Artem Glazychev artem.glazychev@xored.com

Description

Issue link

networkservicemesh/integration-k8s-aws#324

How Has This Been Tested?

  • Added unit testing to cover
  • Tested manually
  • Tested by integration testing
  • Have not tested

Types of changes

  • Bug fix
  • New functionallity
  • Documentation
  • Refactoring
  • CI

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)
Copy link
Member

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?

Copy link
Contributor Author

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

@denis-tingaikin denis-tingaikin merged commit fa94b07 into networkservicemesh:main Dec 15, 2022
nsmbot pushed a commit to networkservicemesh/cmd-ipam-vl3 that referenced this pull request Dec 15, 2022
…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>
nsmbot pushed a commit to networkservicemesh/cmd-map-ip-k8s that referenced this pull request Dec 15, 2022
…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>
nsmbot pushed a commit to networkservicemesh/sdk-kernel that referenced this pull request Dec 15, 2022
…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>
nsmbot pushed a commit to networkservicemesh/cmd-nsc-init that referenced this pull request Dec 15, 2022
…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>
nsmbot pushed a commit to networkservicemesh/cmd-cluster-info-k8s that referenced this pull request Dec 15, 2022
…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>
nsmbot pushed a commit to networkservicemesh/cmd-admission-webhook-k8s that referenced this pull request Dec 15, 2022
…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>
nsmbot pushed a commit to networkservicemesh/sdk-k8s that referenced this pull request Dec 15, 2022
…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>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Dec 15, 2022
…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>
nsmbot pushed a commit to networkservicemesh/cmd-nse-remote-vlan that referenced this pull request Dec 15, 2022
…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>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr-proxy that referenced this pull request Dec 15, 2022
…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>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vfio that referenced this pull request Dec 15, 2022
…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>
nsmbot pushed a commit to networkservicemesh/cmd-registry-memory that referenced this pull request Dec 15, 2022
…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>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr that referenced this pull request Dec 15, 2022
…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>
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.

3 participants