]> Cypherpunks repositories - gostls13.git/commit
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>
Wed, 2 Oct 2019 20:54:54 +0000 (20:54 +0000)
commitf0e940ebc985661f54d31c8d9ba31a553b87041b
tree03b9f5d676aad4ac1ac524664a9be0b1aade56ce
parente85ffec784b867f016805873eec5dc91eec1c99a
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 #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>
src/net/dnsclient_unix.go
src/net/dnsclient_unix_test.go