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