mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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 <bcmills@google.com> Trust: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
222ed1b38a
commit
73496e0df0
1 changed files with 1 additions and 1 deletions
|
|
@ -299,7 +299,7 @@ func lookupPTR(name string) (ptr []string, err error) {
|
||||||
ptr = make([]string, 0, 10)
|
ptr = make([]string, 0, 10)
|
||||||
rx := regexp.MustCompile(`(?m)^Pinging\s+([a-zA-Z0-9.\-]+)\s+\[.*$`)
|
rx := regexp.MustCompile(`(?m)^Pinging\s+([a-zA-Z0-9.\-]+)\s+\[.*$`)
|
||||||
for _, ans := range rx.FindAllStringSubmatch(r, -1) {
|
for _, ans := range rx.FindAllStringSubmatch(r, -1) {
|
||||||
ptr = append(ptr, ans[1]+".")
|
ptr = append(ptr, absDomainName([]byte(ans[1])))
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue