diff options
author | 2020-01-16 14:47:39 -0500 | |
---|---|---|
committer | 2020-01-16 20:47:39 +0100 | |
commit | aa8c325d4a0fc7ac35b4a9b58f984ef6ee0bf3d1 (patch) | |
tree | f8841c4bb7916e178c24cef39748e174120cb5bc /plugin/pkg/parse/host_test.go | |
parent | b7977402d6c3ffd2a7e9b7da310db0579d8447a0 (diff) | |
download | coredns-aa8c325d4a0fc7ac35b4a9b58f984ef6ee0bf3d1.tar.gz coredns-aa8c325d4a0fc7ac35b4a9b58f984ef6ee0bf3d1.tar.zst coredns-aa8c325d4a0fc7ac35b4a9b58f984ef6ee0bf3d1.zip |
Fix HostPortOrFile to support IPv6 addresses with zone (#3527)
1. The HostPortOrFile tests don't have any IPv6 tests. This adds some.
2. The HostPortOrFile breaks if any of the addresses have IPv6 zone
defined. ParseIP does not handle %zone anymore.
Signed-off-by: Brad P. Crochet <brad@redhat.com>
Diffstat (limited to 'plugin/pkg/parse/host_test.go')
-rw-r--r-- | plugin/pkg/parse/host_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/plugin/pkg/parse/host_test.go b/plugin/pkg/parse/host_test.go index f6e771f29..1c23c5bee 100644 --- a/plugin/pkg/parse/host_test.go +++ b/plugin/pkg/parse/host_test.go @@ -34,6 +34,26 @@ func TestHostPortOrFile(t *testing.T) { "127.0.0.1:53", false, }, + { + "fe80::1", + "[fe80::1]:53", + false, + }, + { + "fe80::1%ens3", + "[fe80::1%ens3]:53", + false, + }, + { + "[fd01::1]:153", + "[fd01::1]:153", + false, + }, + { + "[fd01::1%ens3]:153", + "[fd01::1%ens3]:153", + false, + }, } err := ioutil.WriteFile("resolv.conf", []byte("nameserver 127.0.0.1\n"), 0600) |