Skip to content

Commit

Permalink
panic if DNS control fails
Browse files Browse the repository at this point in the history
Closes <#4461>
  • Loading branch information
ReactorScram committed Apr 22, 2024
1 parent dad9c16 commit f514b51
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions rust/connlib/tunnel/src/device_channel/tun_linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,15 @@ async fn set_iface_config(

res_v4.or(res_v6)?;

match dns_control_method {
None => {}
if let Err(error) = match dns_control_method {
None => Ok(()),
Some(DnsControlMethod::EtcResolvConf) => etc_resolv_conf::configure(&dns_config)
.await
.map_err(Error::ResolvConf)?,
Some(DnsControlMethod::NetworkManager) => configure_network_manager(&dns_config)?,
Some(DnsControlMethod::Systemd) => configure_systemd_resolved(&dns_config).await?,
.map_err(Error::ResolvConf),
Some(DnsControlMethod::NetworkManager) => configure_network_manager(&dns_config),
Some(DnsControlMethod::Systemd) => configure_systemd_resolved(&dns_config).await,
} {
panic!("Failed to control DNS: {error}");
}

// TODO: Having this inside the library is definitely wrong. I think `set_iface_config`
Expand Down

0 comments on commit f514b51

Please sign in to comment.