Audit changes

This commit is contained in:
jdl
2026-06-14 08:15:00 +02:00
parent 52ea1a8d42
commit fa182eca76
13 changed files with 29 additions and 15 deletions

View File

@@ -39,6 +39,7 @@ func (a *App) onTick() {
case StateRelayed:
// If we have an ep to probe, add it.
if ep := p.PreferredEndpoint(); ep.IsValid() {
p.ProbeStart = time.Now()
a.devAddProbe(p, ep)
}
@@ -50,6 +51,12 @@ func (a *App) onTick() {
} else if ep := p.PreferredEndpoint(); ep.IsValid() && ep != p.WGEndpoint() {
// Update the probe address if it's changed.
a.devAddProbe(p, ep)
} else if time.Since(p.ProbeStart) > 8*wginterface.ProbeKeepalive {
// Give up probing if we haven't been able to handshake.
p.EndpointV4 = netip.AddrPort{}
p.EndpointV6 = netip.AddrPort{}
p.EndpointLAN = netip.AddrPort{}
a.devAddPeer(p)
}
case StateDirect: