]> Cypherpunks.ru repositories - gostls13.git/commit
net: filter bad names from Lookup functions instead of hard failing
authorRoland Shoemaker <roland@golang.org>
Fri, 2 Jul 2021 17:25:49 +0000 (10:25 -0700)
committerRoland Shoemaker <roland@golang.org>
Thu, 8 Jul 2021 17:53:43 +0000 (17:53 +0000)
commit296ddf2a936a30866303a64d49bc0e3e034730a8
tree755994e91f92f580372da9221304d355f01a0ee5
parentce76298ee7b2cc237b015f798abbfe891a6f5463
net: filter bad names from Lookup functions instead of hard failing

Instead of hard failing on a single bad record, filter the bad records
and return anything valid. This only applies to the methods which can
return multiple records, LookupMX, LookupNS, LookupSRV, and LookupAddr.

When bad results are filtered out, also return an error, indicating
that this filtering has happened.

Updates #46241
Fixes #46979

Change-Id: I6493e0002beaf89f5a9795333a93605abd30d171
Reviewed-on: https://go-review.googlesource.com/c/go/+/332549
Trust: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
src/net/dnsclient_unix_test.go
src/net/lookup.go