From e58d0f3012d86c13dfcb360451ec89782234d310 Mon Sep 17 00:00:00 2001 From: Moses Narrow <36607567+0pcom@users.noreply.github.com> Date: Mon, 23 Feb 2026 14:06:24 -0600 Subject: [PATCH] Fix LookupIP to try alternative servers when non-public IP received When a dmsg server returns a non-public IP address (e.g., from a LAN dmsg server), the client now logs a warning and continues trying other servers instead of immediately returning an error. This ensures visors connected to local dmsg servers can still obtain their public IP for survey generation. --- pkg/dmsg/client.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/dmsg/client.go b/pkg/dmsg/client.go index 9a2ea125d..eaa92efa6 100644 --- a/pkg/dmsg/client.go +++ b/pkg/dmsg/client.go @@ -424,9 +424,10 @@ func (ce *Client) LookupIP(ctx context.Context, servers []cipher.PubKey) (myIP n return ip, nil } - // Check if the IP is public + // Check if the IP is public, if not try other servers if !netutil.IsPublicIP(ip) { - return nil, errors.New("received non-public IP address from dmsg server") + ce.log.WithField("server_pk", srvPK).WithField("ip", ip.String()).Warn("Received non-public IP address from dmsg server, trying other servers.") + continue } return ip, nil } @@ -455,9 +456,10 @@ func (ce *Client) LookupIP(ctx context.Context, servers []cipher.PubKey) (myIP n return ip, nil } - // Check if the IP is public + // Check if the IP is public, if not try other servers if !netutil.IsPublicIP(ip) { - return nil, errors.New("received non-public IP address from dmsg server") + ce.log.WithField("server_pk", srvPK).WithField("ip", ip.String()).Warn("Received non-public IP address from dmsg server, trying other servers.") + continue } return ip, nil }