mirror of
https://github.com/tailscale/tailscale.git
synced 2024-12-01 14:05:39 +00:00
wgengine/magicsock: reset favorite address on handshakes
Updates #92 (not a complete fix; could be better/faster?) Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
517a91de75
commit
1abf2da392
@ -409,6 +409,11 @@ func appendDests(dsts []*net.UDPAddr, as *AddrSet, b []byte) (_ []*net.UDPAddr,
|
||||
if spray {
|
||||
as.lastSpray = now
|
||||
as.stopSpray = now.Add(sprayPeriod)
|
||||
|
||||
// Reset our favorite route on new handshakes so we
|
||||
// can downgrade to a worse path if our better path
|
||||
// goes away. (https://github.com/tailscale/tailscale/issues/92)
|
||||
as.curAddr = -1
|
||||
} else if now.Before(as.stopSpray) {
|
||||
// We are in the spray window. If it has been sprayFreq since we
|
||||
// last sprayed a packet, spray this packet.
|
||||
|
Loading…
Reference in New Issue
Block a user