From 4b905f4eab469e9519798a94a8b67145cb5a840f Mon Sep 17 00:00:00 2001 From: Kleissner Date: Wed, 21 Apr 2021 03:42:46 +0200 Subject: [PATCH] Enable local peer discovery for public IPv4s for now. --- Commands.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Commands.go b/Commands.go index 3c74cc3..6fe3a63 100644 --- a/Commands.go +++ b/Commands.go @@ -8,7 +8,6 @@ package core import ( "bytes" - "encoding/hex" "fmt" "log" "time" @@ -198,12 +197,13 @@ func (peer *PeerInfo) cmdChat(msg *MessageRaw) { // cmdLocalDiscovery handles an incoming announcement via local discovery func (peer *PeerInfo) cmdLocalDiscovery(msg *MessageAnnouncement) { + // 21.04.2021 update: Local peer discovery from public IPv4s is possible in datacenter situations. Keep it enabled for now. // only accept local discovery message from private IPs for IPv4 // IPv6 DHCP routers typically assign public IPv6s and they can join multicast in the local network. - if msg.connection.IsIPv4() && !msg.connection.IsLocal() { - log.Printf("cmdLocalDiscovery message received from non-local IP %s peer ID %s\n", msg.connection.Address.String(), hex.EncodeToString(msg.SenderPublicKey.SerializeCompressed())) - return - } + //if msg.connection.IsIPv4() && !msg.connection.IsLocal() { + // log.Printf("cmdLocalDiscovery message received from non-local IP %s peer ID %s\n", msg.connection.Address.String(), hex.EncodeToString(msg.SenderPublicKey.SerializeCompressed())) + // return + //} if peer == nil { peer, _ = PeerlistAdd(msg.SenderPublicKey, msg.connection)