all: use network less when running in v86 emulator

Updates #5794

Change-Id: I1d8b005a1696835c9062545f87b7bab643cfc44d
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2025-04-01 04:01:00 -07:00
committed by Brad Fitzpatrick
parent 29c2bb1db6
commit 65c7a37bc6
6 changed files with 104 additions and 6 deletions

View File

@@ -719,7 +719,7 @@ func (c *Conn) updateEndpoints(why string) {
c.muCond.Broadcast()
}()
c.dlogf("[v1] magicsock: starting endpoint update (%s)", why)
if c.noV4Send.Load() && runtime.GOOS != "js" && !c.onlyTCP443.Load() {
if c.noV4Send.Load() && runtime.GOOS != "js" && !c.onlyTCP443.Load() && !hostinfo.IsInVM86() {
c.mu.Lock()
closed := c.closed
c.mu.Unlock()
@@ -2767,7 +2767,9 @@ func (c *Conn) Rebind() {
c.logf("Rebind; defIf=%q, ips=%v", defIf, ifIPs)
}
c.maybeCloseDERPsOnRebind(ifIPs)
if len(ifIPs) > 0 {
c.maybeCloseDERPsOnRebind(ifIPs)
}
c.resetEndpointStates()
}