mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-16 11:41:39 +00:00
wgengine/magicsock, controlclient, net/dns: reduce some logspam
Updates #cleanup Change-Id: I78b0697a01e94baa33f3de474b591e616fa5e6af Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
08302c0731
commit
3b32d6c679
@ -1501,7 +1501,7 @@ func (c *Direct) getNoiseClient() (*NoiseClient, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
c.logf("creating new noise client")
|
c.logf("[v1] creating new noise client")
|
||||||
nc, err := NewNoiseClient(NoiseOpts{
|
nc, err := NewNoiseClient(NoiseOpts{
|
||||||
PrivKey: k,
|
PrivKey: k,
|
||||||
ServerPubKey: serverNoiseKey,
|
ServerPubKey: serverNoiseKey,
|
||||||
|
@ -97,7 +97,9 @@ func (m *Manager) Set(cfg Config) error {
|
|||||||
m.logf("Resolvercfg: %v", logger.ArgWriter(func(w *bufio.Writer) {
|
m.logf("Resolvercfg: %v", logger.ArgWriter(func(w *bufio.Writer) {
|
||||||
rcfg.WriteToBufioWriter(w)
|
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 {
|
if err := m.resolver.SetConfig(rcfg); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"tailscale.com/types/logger"
|
"tailscale.com/types/logger"
|
||||||
"tailscale.com/util/dnsname"
|
"tailscale.com/util/dnsname"
|
||||||
@ -65,6 +66,42 @@ type OSConfig struct {
|
|||||||
MatchDomains []dnsname.FQDN
|
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 {
|
func (o OSConfig) IsZero() bool {
|
||||||
return len(o.Nameservers) == 0 && len(o.SearchDomains) == 0 && len(o.MatchDomains) == 0
|
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.
|
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 {
|
func (c *Conn) PeerMTUEnabled() bool {
|
||||||
return c.peerMTUEnabled.Load()
|
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.
|
// peer path MTU discovery according to the current configuration.
|
||||||
//
|
//
|
||||||
// Enabling or disabling peer path MTU discovery requires setting the don't
|
// Enabling or disabling peer path MTU discovery requires setting the don't
|
||||||
@ -84,7 +84,7 @@ func (c *Conn) UpdatePMTUD() {
|
|||||||
|
|
||||||
enable := c.ShouldPMTUD()
|
enable := c.ShouldPMTUD()
|
||||||
if c.peerMTUEnabled.Load() == enable {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user