Skip to content

Commit

Permalink
Fix build on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
moubctez committed Jan 7, 2025
1 parent 943f9ff commit 74dafcb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/wgapi_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,15 @@ impl WireguardInterfaceApi for WGApi<Kernel> {

debug!("WireGuard configuration file {file_name} created in {file_path}. Preparing configuration...");

let address = config
.addresses
.iter()
.map(|addr| addr.to_string())
.collect::<Vec<String>>()
.join(",");
let mut wireguard_configuration = format!(
"[Interface]\nPrivateKey = {}\nAddress = {}\n",
config.prvkey, config.address
"[Interface]\nPrivateKey = {}\nAddress = {address}\n",
config.prvkey
);

if !dns.is_empty() {
Expand Down Expand Up @@ -315,7 +321,7 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
fn configure_dns(
&self,
dns: &[IpAddr],
search_domains: &[&str],
_search_domains: &[&str],
) -> Result<(), WireguardInterfaceError> {
debug!(
"Configuring DNS for interface {}, using address: {dns:?}",
Expand Down

0 comments on commit 74dafcb

Please sign in to comment.