mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
fix(rust/gui-client/windows): read DNS servers before starting connlib (#6455)
Closes #6453 --------- Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com> Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
This commit is contained in:
@@ -1119,7 +1119,8 @@ impl ClientState {
|
||||
|
||||
fn update_dns_mapping(&mut self) {
|
||||
let Some(config) = &self.interface_config else {
|
||||
tracing::debug!("Unable to update DNS servesr without interface configuration");
|
||||
// For the Tauri clients this can happen because it's called immediately after phoenix_channel's connect, before on_set_interface_config
|
||||
tracing::debug!("Unable to update DNS servers without interface configuration");
|
||||
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -492,13 +492,17 @@ impl<'a> Handler<'a> {
|
||||
)
|
||||
.map_err(|e| Error::PortalConnection(e.to_string()))?;
|
||||
|
||||
// Read the resolvers before starting connlib, in case connlib's startup interferes.
|
||||
let dns = self.dns_controller.system_resolvers();
|
||||
let new_session = Session::connect(args, portal, tokio::runtime::Handle::current());
|
||||
// Call `set_dns` before `set_tun` so that the tunnel starts up with a valid list of resolvers.
|
||||
tracing::debug!(?dns, "Calling `set_dns`...");
|
||||
new_session.set_dns(dns);
|
||||
let tun = self
|
||||
.tun_device
|
||||
.make_tun()
|
||||
.map_err(|e| Error::TunnelDevice(e.to_string()))?;
|
||||
new_session.set_tun(Box::new(tun));
|
||||
new_session.set_dns(self.dns_controller.system_resolvers());
|
||||
self.connlib = Some(new_session);
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user