Audit changes
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user