Skip to content

Commit a919cf7

Browse files
committed
Fix build on Windows
1 parent 0db4ea7 commit a919cf7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/wgapi_windows.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
232232
allowed_ips: peer
233233
.allowed_ips
234234
.iter()
235-
.filter_map(|ip| match ip.ip {
235+
.filter_map(|ip| match ip.address {
236236
IpAddr::V4(addr) => Some(IpNet::V4(Ipv4Net::new(addr, ip.cidr).ok()?)),
237237
IpAddr::V6(addr) => Some(IpNet::V6(Ipv6Net::new(addr, ip.cidr).ok()?)),
238238
})
@@ -248,7 +248,7 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
248248
// Configure the interface
249249
debug!("Applying configuration for adapter {}", self.ifname);
250250
let interface = wireguard_nt::SetInterface {
251-
listen_port: Some(config.port as u16),
251+
listen_port: Some(config.port),
252252
public_key: None, // derived from private key
253253
private_key: Some(Key::from_str(&config.prvkey)?.as_array()),
254254
peers,
@@ -263,7 +263,7 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
263263
let addresses: Vec<_> = config
264264
.addresses
265265
.iter()
266-
.filter_map(|ip| match ip.ip {
266+
.filter_map(|ip| match ip.address {
267267
IpAddr::V4(addr) => Some(IpNet::V4(Ipv4Net::new(addr, ip.cidr).ok()?)),
268268
IpAddr::V6(addr) => Some(IpNet::V6(Ipv6Net::new(addr, ip.cidr).ok()?)),
269269
})

0 commit comments

Comments
 (0)