Cleanup - audit

This commit is contained in:
jdl
2026-06-13 20:18:13 +02:00
parent 393f79e1d3
commit 9bdb836eaa

View File

@@ -34,8 +34,11 @@ func (a *App) onPing(e PingEvent) {
// We can only learn our own endpoint from directly-connected peers — Dst
// is the sender's observation of our WG handshake source.
//
// We make sure we don't set a private address as our public address since we
// may be connected via LAN to some peers.
if peer.State == StateDirect {
if dst := e.ping.Dst; dst.IsValid() {
if dst := e.ping.Dst; dst.IsValid() && !dst.Addr().IsPrivate() {
if dst.Addr().Is4() {
if dst != a.selfV4 {
log.Printf("Local IPv4 updated: %s -> %s", a.selfV4, dst)