• Ben Burkert's avatar
    net: support all PacketConn and Conn returned by Resolver.Dial · d8a7990f
    Ben Burkert authored
    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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    d8a7990f
dnsclient_unix.go 15.9 KB