]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.13] net: avoid an infinite loop in LookupAddr
authorMichael Hendricks <michael@ndrix.org>
Wed, 2 Oct 2019 15:30:51 +0000 (09:30 -0600)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 3 Oct 2019 02:07:28 +0000 (02:07 +0000)
commitf262eed9600a00f43c929d2761f02c2cecc3b0d1
tree91733e983be814ddc4cb2b495d4681a6eaf09e2e
parent8a6cd7a082cb0c15bc4eef19519506125e76f66a
[release-branch.go1.13] net: avoid an infinite loop in LookupAddr

If a request for a PTR record returned a response with a non-PTR
answer, goLookupPTR would loop forever.  Skipping non-PTR answers
guarantees progress through the DNS response.

Fixes #34662
Updates #34660

Change-Id: I56f9d21e5342d07e7d843d253267e93a29707904
Reviewed-on: https://go-review.googlesource.com/c/go/+/198460
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit f0e940ebc985661f54d31c8d9ba31a553b87041b)
Reviewed-on: https://go-review.googlesource.com/c/go/+/198489
Reviewed-by: Michael Hendricks <michael@ndrix.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
src/net/dnsclient_unix.go
src/net/dnsclient_unix_test.go