mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-28 04:26:26 -08:00
net/tstun: only log natConfig on changes
Updates tailscale/corp#8020 Signed-off-by: Maisem Ali <[email protected]>
This commit is contained in:
1 parent
8ac5976897
commit
d2fd101eb4
1 file changed
+5
-2
+5
-2
@@ -11,6 +11,7 @@ import (
|
||||
"io"
|
||||
"net/netip"
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@@ -594,8 +595,10 @@ func natConfigFromNetMap(nm *netmap.NetworkMap) *natV4Config {
|
||||
// It currently (2023-03-01) only updates the IPv4 NAT configuration.
|
||||
func (t *Wrapper) SetNetMap(nm *netmap.NetworkMap) {
|
||||
cfg := natConfigFromNetMap(nm)
|
||||
t.natV4Config.Store(cfg)
|
||||
t.logf("nat config: %+v", cfg)
|
||||
old := t.natV4Config.Swap(cfg)
|
||||
if !reflect.DeepEqual(old, cfg) {
|
||||
t.logf("nat config: %+v", cfg)
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
Reference in new issue
Block a user