net/dns/resolver: don't spam logs on EHOSTUNREACH.

Fixes #1719.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson 2021-04-20 18:54:15 -07:00 committed by Dave Anderson
parent 0141390365
commit 7fab244614

View File

@ -14,6 +14,7 @@
"math/rand" "math/rand"
"net" "net"
"sync" "sync"
"syscall"
"time" "time"
dns "golang.org/x/net/dns/dnsmessage" dns "golang.org/x/net/dns/dnsmessage"
@ -371,6 +372,12 @@ func (c *fwdConn) send(packet []byte, dst netaddr.IPPort) {
backOff(err) backOff(err)
continue continue
} }
if errors.Is(err, syscall.EHOSTUNREACH) {
// "No route to host." The network stack is fine, but
// can't talk to this destination. Not much we can do
// about that, don't spam logs.
return
}
if networkIsDown(err) { if networkIsDown(err) {
// Fail. // Fail.
c.logf("send: network is down") c.logf("send: network is down")