Fixed bug - update probe address if it changes between ticks
This commit is contained in:
@@ -118,7 +118,7 @@ func (a *App) onShutdown() error {
|
|||||||
func (a *App) logNetworkState() {
|
func (a *App) logNetworkState() {
|
||||||
var b strings.Builder
|
var b strings.Builder
|
||||||
fmt.Fprintf(&b, "Network state (self: %s public=%v):\n", a.vpnIP, a.isPublic)
|
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, " IPv4: %v\n", a.selfV4)
|
||||||
fmt.Fprintf(&b, " IPv6: %v\n", a.selfV6)
|
fmt.Fprintf(&b, " IPv6: %v\n", a.selfV6)
|
||||||
|
|
||||||
|
|||||||
@@ -42,10 +42,13 @@ func (a *App) onTick() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case StateProbing:
|
case StateProbing:
|
||||||
|
if time.Since(p.LastHandshakeTime()) < 2*wginterface.ProbeKeepalive {
|
||||||
// Promote probing peers to direct once alive (direct path confirmed
|
// Promote probing peers to direct once alive (direct path confirmed
|
||||||
// working).
|
// working).
|
||||||
if time.Since(p.LastHandshakeTime()) < 2*wginterface.ProbeKeepalive {
|
|
||||||
a.devPromote(p)
|
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:
|
case StateDirect:
|
||||||
|
|||||||
Reference in New Issue
Block a user