Fixed bug - update probe address if it changes between ticks

This commit is contained in:
jdl
2026-06-13 21:21:55 +02:00
parent 3fe9f63901
commit c45ac83eb0
2 changed files with 6 additions and 3 deletions

View File

@@ -118,7 +118,7 @@ func (a *App) onShutdown() error {
func (a *App) logNetworkState() {
var b strings.Builder
fmt.Fprintf(&b, "Network state (self: %s public=%v):\n", a.vpnIP, a.isPublic)
fmt.Fprintf(&b, " Network: %v", a.vpnNet)
fmt.Fprintf(&b, " Network: %v\n", a.vpnNet)
fmt.Fprintf(&b, " IPv4: %v\n", a.selfV4)
fmt.Fprintf(&b, " IPv6: %v\n", a.selfV6)

View File

@@ -42,10 +42,13 @@ func (a *App) onTick() {
}
case StateProbing:
if time.Since(p.LastHandshakeTime()) < 2*wginterface.ProbeKeepalive {
// Promote probing peers to direct once alive (direct path confirmed
// working).
if time.Since(p.LastHandshakeTime()) < 2*wginterface.ProbeKeepalive {
a.devPromote(p)
} else if ep := p.PreferredEndpoint(); ep.IsValid() && ep != p.WGEndpoint() {
// Update the probe address if it's changed.
a.devAddProbe(p, ep)
}
case StateDirect: