diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index 64ffa5de9..a19c030b4 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -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, diff --git a/net/dns/manager.go b/net/dns/manager.go index f177b5777..cee7d7ede 100644 --- a/net/dns/manager.go +++ b/net/dns/manager.go @@ -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 diff --git a/net/dns/osconfig.go b/net/dns/osconfig.go index b12e6418b..f3c9016a7 100644 --- a/net/dns/osconfig.go +++ b/net/dns/osconfig.go @@ -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("") + 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 } diff --git a/wgengine/magicsock/peermtu.go b/wgengine/magicsock/peermtu.go index 177f5d4fc..8013aa5ea 100644 --- a/wgengine/magicsock/peermtu.go +++ b/wgengine/magicsock/peermtu.go @@ -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 }