@ -40,6 +40,11 @@ import (
var mtuProbePingSizesV4 [ ] int
var mtuProbePingSizesV4 [ ] int
var mtuProbePingSizesV6 [ ] int
var mtuProbePingSizesV6 [ ] int
// discoKeyAdvertisementInterval tells how often a disco update via TSMP can
// happen. The update is triggered via enqueueCallMeMaybe, and thus it will
// only be sent if the magicsock is in a state to send out CallMeMaybe.
const discoKeyAdvertisementInterval = time . Second * 60
func init ( ) {
func init ( ) {
for _ , m := range tstun . WireMTUsToProbe {
for _ , m := range tstun . WireMTUsToProbe {
mtuProbePingSizesV4 = append ( mtuProbePingSizesV4 , pktLenToPingSize ( m , false ) )
mtuProbePingSizesV4 = append ( mtuProbePingSizesV4 , pktLenToPingSize ( m , false ) )
@ -80,7 +85,7 @@ type endpoint struct {
lastSendAny mono . Time // last time there were outgoing packets sent this peer from any trigger, internal or external to magicsock
lastSendAny mono . Time // last time there were outgoing packets sent this peer from any trigger, internal or external to magicsock
lastFullPing mono . Time // last time we pinged all disco or wireguard only endpoints
lastFullPing mono . Time // last time we pinged all disco or wireguard only endpoints
lastUDPRelayPathDiscovery mono . Time // last time we ran UDP relay path discovery
lastUDPRelayPathDiscovery mono . Time // last time we ran UDP relay path discovery
sentDiscoKeyAdvertisement bool // whether we sent a TSMPDiscoAdvertisement or not to this endpoint
lastDiscoKeyAdvertisement mono . Time // last time we sent a TSMPDiscoAdvertisement or not to this endpoint
derpAddr netip . AddrPort // fallback/bootstrap path, if non-zero (non-zero for well-behaved clients)
derpAddr netip . AddrPort // fallback/bootstrap path, if non-zero (non-zero for well-behaved clients)
bestAddr addrQuality // best non-DERP path; zero if none; mutate via setBestAddrLocked()
bestAddr addrQuality // best non-DERP path; zero if none; mutate via setBestAddrLocked()