Skip to content

Commit 74dafcb

Browse files
committed
Fix build on Windows
1 parent 943f9ff commit 74dafcb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/wgapi_windows.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,15 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
5353

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

56+
let address = config
57+
.addresses
58+
.iter()
59+
.map(|addr| addr.to_string())
60+
.collect::<Vec<String>>()
61+
.join(",");
5662
let mut wireguard_configuration = format!(
57-
"[Interface]\nPrivateKey = {}\nAddress = {}\n",
58-
config.prvkey, config.address
63+
"[Interface]\nPrivateKey = {}\nAddress = {address}\n",
64+
config.prvkey
5965
);
6066

6167
if !dns.is_empty() {
@@ -315,7 +321,7 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
315321
fn configure_dns(
316322
&self,
317323
dns: &[IpAddr],
318-
search_domains: &[&str],
324+
_search_domains: &[&str],
319325
) -> Result<(), WireguardInterfaceError> {
320326
debug!(
321327
"Configuring DNS for interface {}, using address: {dns:?}",

0 commit comments

Comments
 (0)