netcheck, stunner: reduce log spam

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-02-28 09:40:25 -08:00
parent 19b54d0ae7
commit f3c0ea23d9
3 changed files with 8 additions and 4 deletions

View File

@@ -112,7 +112,6 @@ func (s *Stunner) Receive(p []byte, fromAddr *net.UDPAddr) {
session := s.sessions[r.server]
if session != nil {
host := net.JoinHostPort(net.IP(addr).String(), fmt.Sprint(port))
s.logf("STUN server %s reports public endpoint %s after %v", r.server, host, d)
s.Endpoint(r.server, host, d)
session.cancel()
}
@@ -127,6 +126,10 @@ func (s *Stunner) resolver() *net.Resolver {
// Run starts a Stunner and blocks until all servers either respond
// or are tried multiple times and timeout.
//
// TODO: this always returns success now. It should return errors
// if certain servers are unavailable probably. Or if all are.
// Or some configured threshold are.
func (s *Stunner) Run(ctx context.Context) error {
s.sessions = map[string]*session{}
for _, server := range s.Servers {