Audit changes.

This commit is contained in:
jdl
2026-06-13 19:30:03 +02:00
parent c4a81cf553
commit c325180a1b
2 changed files with 43 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
package peer
import (
"log"
"net/netip"
"time"
@@ -37,9 +38,15 @@ func (a *App) onPing(e PingEvent) {
if peer.State == StateDirect {
if dst := e.ping.Dst; dst.IsValid() {
if dst.Addr().Is4() {
a.selfV4 = dst
if dst != a.selfV4 {
log.Printf("Local IPv4 updated: %s -> %s", a.selfV4, dst)
a.selfV4 = dst
}
} else {
a.selfV6 = dst
if dst != a.selfV6 {
log.Printf("Local IPv6 updated: %s -> %s", a.selfV6, dst)
a.selfV6 = dst
}
}
}
return