mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-18 02:48:40 +00:00
ipn/local: don't print packet filter every single time.
It's extremely noisy right now for domains with complex ACLs.
This commit is contained in:
parent
a56e853b72
commit
4336de0d98
11
ipn/local.go
11
ipn/local.go
@ -37,6 +37,7 @@ type LocalBackend struct {
|
||||
backendLogID string
|
||||
portpoll *portlist.Poller // may be nil
|
||||
newDecompressor func() (controlclient.Decompressor, error)
|
||||
lastFilterPrint time.Time
|
||||
|
||||
// The mutex protects the following elements.
|
||||
mu sync.Mutex
|
||||
@ -310,7 +311,15 @@ func (b *LocalBackend) updateFilter(netMap *controlclient.NetworkMap) {
|
||||
// Not configured yet, block everything
|
||||
b.e.SetFilter(filter.NewAllowNone())
|
||||
} else {
|
||||
b.logf("netmap packet filter: %v\n", b.netMapCache.PacketFilter)
|
||||
// TODO(apenwarr): don't replace filter at all if unchanged.
|
||||
// TODO(apenwarr): print a diff instead of full filter.
|
||||
now := time.Now()
|
||||
if now.Sub(b.lastFilterPrint) > 1*time.Minute {
|
||||
b.logf("netmap packet filter: %v\n", b.netMapCache.PacketFilter)
|
||||
b.lastFilterPrint = now
|
||||
} else {
|
||||
b.logf("netmap packet filter: (suppressed)\n")
|
||||
}
|
||||
b.e.SetFilter(filter.New(netMap.PacketFilter))
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user