|
|
@ -11,6 +11,7 @@ import (
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
"net/netip"
|
|
|
|
"net/netip"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"reflect"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
"sync"
|
|
|
|
"sync"
|
|
|
|
"sync/atomic"
|
|
|
|
"sync/atomic"
|
|
|
@ -594,9 +595,11 @@ func natConfigFromNetMap(nm *netmap.NetworkMap) *natV4Config {
|
|
|
|
// It currently (2023-03-01) only updates the IPv4 NAT configuration.
|
|
|
|
// It currently (2023-03-01) only updates the IPv4 NAT configuration.
|
|
|
|
func (t *Wrapper) SetNetMap(nm *netmap.NetworkMap) {
|
|
|
|
func (t *Wrapper) SetNetMap(nm *netmap.NetworkMap) {
|
|
|
|
cfg := natConfigFromNetMap(nm)
|
|
|
|
cfg := natConfigFromNetMap(nm)
|
|
|
|
t.natV4Config.Store(cfg)
|
|
|
|
old := t.natV4Config.Swap(cfg)
|
|
|
|
|
|
|
|
if !reflect.DeepEqual(old, cfg) {
|
|
|
|
t.logf("nat config: %+v", cfg)
|
|
|
|
t.logf("nat config: %+v", cfg)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
var (
|
|
|
|
magicDNSIPPort = netip.AddrPortFrom(tsaddr.TailscaleServiceIP(), 0) // 100.100.100.100:0
|
|
|
|
magicDNSIPPort = netip.AddrPortFrom(tsaddr.TailscaleServiceIP(), 0) // 100.100.100.100:0
|
|
|
|