wgengine/magicsock, controlclient, net/dns: reduce some logspam

Updates #cleanup

Change-Id: I78b0697a01e94baa33f3de474b591e616fa5e6af
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/9527/head
Brad Fitzpatrick 7 months ago committed by Brad Fitzpatrick
parent 08302c0731
commit 3b32d6c679

@ -1501,7 +1501,7 @@ func (c *Direct) getNoiseClient() (*NoiseClient, error) {
if err != nil {
return nil, err
}
c.logf("creating new noise client")
c.logf("[v1] creating new noise client")
nc, err := NewNoiseClient(NoiseOpts{
PrivKey: k,
ServerPubKey: serverNoiseKey,

@ -97,7 +97,9 @@ func (m *Manager) Set(cfg Config) error {
m.logf("Resolvercfg: %v", logger.ArgWriter(func(w *bufio.Writer) {
rcfg.WriteToBufioWriter(w)
}))
m.logf("OScfg: %+v", ocfg)
m.logf("OScfg: %v", logger.ArgWriter(func(w *bufio.Writer) {
ocfg.WriteToBufioWriter(w)
}))
if err := m.resolver.SetConfig(rcfg); err != nil {
return err

@ -8,6 +8,7 @@ import (
"errors"
"fmt"
"net/netip"
"strings"
"tailscale.com/types/logger"
"tailscale.com/util/dnsname"
@ -65,6 +66,42 @@ type OSConfig struct {
MatchDomains []dnsname.FQDN
}
func (o *OSConfig) WriteToBufioWriter(w *bufio.Writer) {
if o == nil {
w.WriteString("<nil>")
return
}
w.WriteString("{")
if len(o.Hosts) > 0 {
fmt.Fprintf(w, "Hosts:%v ", o.Hosts)
}
if len(o.Nameservers) > 0 {
fmt.Fprintf(w, "Nameservers:%v ", o.Nameservers)
}
if len(o.SearchDomains) > 0 {
fmt.Fprintf(w, "SearchDomains:%v ", o.SearchDomains)
}
if len(o.MatchDomains) > 0 {
w.WriteString("SearchDomains:[")
sp := ""
var numARPA int
for _, s := range o.MatchDomains {
if strings.HasSuffix(string(s), ".arpa.") {
numARPA++
continue
}
w.WriteString(sp)
w.WriteString(string(s))
sp = " "
}
w.WriteString("]")
if numARPA > 0 {
fmt.Fprintf(w, "+%darpa", numARPA)
}
}
w.WriteString("}")
}
func (o OSConfig) IsZero() bool {
return len(o.Nameservers) == 0 && len(o.SearchDomains) == 0 && len(o.MatchDomains) == 0
}

@ -48,12 +48,12 @@ func (c *Conn) ShouldPMTUD() bool {
return false // Until we feel confident PMTUD is solid.
}
// PeerMTUEnabled returns true if this Conn is has peer path MTU discovery enabled.
// PeerMTUEnabled reports whether peer path MTU discovery is enabled.
func (c *Conn) PeerMTUEnabled() bool {
return c.peerMTUEnabled.Load()
}
// UpdatePMTUD configures underlying sockets of this Conn to enable or disable
// UpdatePMTUD configures the underlying sockets of this Conn to enable or disable
// peer path MTU discovery according to the current configuration.
//
// Enabling or disabling peer path MTU discovery requires setting the don't
@ -84,7 +84,7 @@ func (c *Conn) UpdatePMTUD() {
enable := c.ShouldPMTUD()
if c.peerMTUEnabled.Load() == enable {
c.logf("magicsock: peermtu: peer MTU status is %v", enable)
c.logf("[v1] magicsock: peermtu: peer MTU status is %v", enable)
return
}

Loading…
Cancel
Save