diff --git a/Cargo.toml b/Cargo.toml index fa562b93..a594c7bd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tun2" -version = "3.1.6" +version = "3.1.7" edition = "2021" authors = ["meh. ", "@ssrlive"] license = "WTFPL" diff --git a/src/platform/windows/device.rs b/src/platform/windows/device.rs index b5a42ca8..23df0be1 100644 --- a/src/platform/windows/device.rs +++ b/src/platform/windows/device.rs @@ -165,7 +165,10 @@ impl AbstractDevice for Device { let addresses = tun.session.get_adapter().get_addresses()?; addresses .iter() - .find_map(|a| Some(*a)) + .find_map(|a| match a { + std::net::IpAddr::V4(a) => Some(std::net::IpAddr::V4(*a)), + _ => None, + }) .ok_or(Error::InvalidConfig) } Driver::Tap(_tap) => unimplemented!(), @@ -193,7 +196,10 @@ impl AbstractDevice for Device { .get_adapter() .get_gateways()? .iter() - .find_map(|a| Some(*a)) + .find_map(|a| match a { + std::net::IpAddr::V4(a) => Some(std::net::IpAddr::V4(*a)), + _ => None, + }) .ok_or(Error::InvalidConfig), Driver::Tap(_tap) => unimplemented!(), }