From: Bryan C. Mills Date: Wed, 23 Jun 2021 01:24:57 +0000 (-0400) Subject: net: use absDomainName in the Windows lookupPTR test helper X-Git-Tag: go1.17rc1~55 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=73496e0df0ba4284f460d1955ddf6bb096957c9f;p=gostls13.git net: use absDomainName in the Windows lookupPTR test helper The real net code uses subtle heuristics to transform a domain name to its absolute form. Since lookupPTR isn't checking that transformation specifically, it should use the real code instead of using a different heuristic. Fixes #46882 Change-Id: I503357e0f62059c37c359cd54b44d343c7d5ab2a Reviewed-on: https://go-review.googlesource.com/c/go/+/330249 Trust: Bryan C. Mills Trust: Alex Brainman Run-TryBot: Bryan C. Mills TryBot-Result: Go Bot Reviewed-by: Alex Brainman Reviewed-by: Ian Lance Taylor --- diff --git a/src/net/lookup_windows_test.go b/src/net/lookup_windows_test.go index 62b61ed6c2..aa95501d02 100644 --- a/src/net/lookup_windows_test.go +++ b/src/net/lookup_windows_test.go @@ -299,7 +299,7 @@ func lookupPTR(name string) (ptr []string, err error) { ptr = make([]string, 0, 10) rx := regexp.MustCompile(`(?m)^Pinging\s+([a-zA-Z0-9.\-]+)\s+\[.*$`) for _, ans := range rx.FindAllStringSubmatch(r, -1) { - ptr = append(ptr, ans[1]+".") + ptr = append(ptr, absDomainName([]byte(ans[1]))) } return }