]> Cypherpunks repositories - gostls13.git/commit
net: support all PacketConn and Conn returned by Resolver.Dial
authorBen Burkert <ben@benburkert.com>
Thu, 8 Jun 2017 20:19:28 +0000 (13:19 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 8 Jun 2017 21:53:49 +0000 (21:53 +0000)
commitd8a7990ffad9aebfb7261df7afb3049da4a09986
treef6fdbc5971109fd6220387507140a50e55251cac
parentd55d7b93978e1a10b6588962f999d3ebd6d65a3d
net: support all PacketConn and Conn returned by Resolver.Dial

Allow the Resolver.Dial func to return instances of Conn other than
*TCPConn and *UDPConn. If the Conn is also a PacketConn, assume DNS
messages transmitted over the Conn adhere to section 4.2.1. "UDP usage".
Otherwise, follow section 4.2.2. "TCP usage".

Provides a hook mechanism so that DNS queries generated by the net
package may be answered or modified before being sent to over the
network.

Updates #19910

Change-Id: Ib089a28ad4a1848bbeaf624ae889f1e82d56655b
Reviewed-on: https://go-review.googlesource.com/45153
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
src/net/lookup.go
src/net/lookup_unix.go