diff --git a/cmd/discosrv/querysrv.go b/cmd/discosrv/querysrv.go index 9cd5a8912..d1d4f3d56 100644 --- a/cmd/discosrv/querysrv.go +++ b/cmd/discosrv/querysrv.go @@ -329,10 +329,12 @@ func (s *querysrv) handleAnnounce(ctx context.Context, remote net.IP, deviceID p } ip := net.ParseIP(host) - if len(ip) == 0 || ip.IsUnspecified() { - uri.Host = net.JoinHostPort(remote.String(), port) + if host == "" || ip.IsUnspecified() { + host = remote.String() } + uri.Host = net.JoinHostPort(host, port) + if err := s.updateAddress(ctx, tx, deviceID, uri.String()); err != nil { internalErr = err return