From 86fb695189364fd0ab4472fa0577f8c624b3f073 Mon Sep 17 00:00:00 2001 From: bleeee <34237584+bleeee@users.noreply.github.com> Date: Sun, 18 Mar 2018 05:39:46 +0800 Subject: [PATCH] Fix 2.0.6 ipv6 attach port (#237) * fix-2.0.6-ipv6-attach-port --- dnscrypt-proxy/stamps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnscrypt-proxy/stamps.go b/dnscrypt-proxy/stamps.go index 26984813..3f0f6c6a 100644 --- a/dnscrypt-proxy/stamps.go +++ b/dnscrypt-proxy/stamps.go @@ -99,7 +99,7 @@ func newDNSCryptServerStamp(bin []byte) (ServerStamp, error) { pos++ stamp.serverAddrStr = string(bin[pos : pos+len]) pos += len - if net.ParseIP(stamp.serverAddrStr) != nil { + if (net.ParseIP(strings.TrimRight(strings.TrimLeft(stamp.serverAddrStr, "["), "]"))) != nil { stamp.serverAddrStr = fmt.Sprintf("%s:%d", stamp.serverAddrStr, DefaultPort) }