summaryrefslogtreecommitdiffhomepage
path: root/talpid-core
diff options
context:
space:
mode:
authorEmīls Piņķis <emils@mullvad.net>2019-02-05 11:18:20 +0000
committerEmīls Piņķis <emils@mullvad.net>2019-02-05 11:18:20 +0000
commit0d20edce0e6d8fdd8241d502e4e914307cc12fb2 (patch)
treedad5f0bfdc1428b79b5a3c2d3a55532bbb14e334 /talpid-core
parent54142b0fa0b26a33d8e6181a61e03b4b46abda00 (diff)
parent01d6d3d874fde5ad8c4ed7f7152e25841aff2433 (diff)
downloadmullvadvpn-0d20edce0e6d8fdd8241d502e4e914307cc12fb2.tar.xz
mullvadvpn-0d20edce0e6d8fdd8241d502e4e914307cc12fb2.zip
Merge branch 'adjust-cli-gui-for-wg'
Diffstat (limited to 'talpid-core')
-rw-r--r--talpid-core/Cargo.toml5
-rw-r--r--talpid-core/src/tunnel/wireguard/config.rs9
2 files changed, 9 insertions, 5 deletions
diff --git a/talpid-core/Cargo.toml b/talpid-core/Cargo.toml
index cc76d632e0..154440f13c 100644
--- a/talpid-core/Cargo.toml
+++ b/talpid-core/Cargo.toml
@@ -27,7 +27,7 @@ talpid-types = { path = "../talpid-types" }
[target.'cfg(unix)'.dependencies]
hex = "0.3"
-ipnetwork = "0.13"
+ipnetwork = "0.14"
lazy_static = "1.0"
tun = { git = "https://github.com/pinkisemils/rust-tun", branch = "add-raw-fd-traits" }
nix = "0.12"
@@ -46,7 +46,8 @@ which = "2.0"
err-derive = "0.1.5"
[target.'cfg(target_os = "macos")'.dependencies]
-pfctl = "0.2"
+# TODO: Specify 0.2.1 once the crate gets published
+pfctl = { git = "https://github.com/mullvad/pfctl-rs", rev = "9f31b5ddcab941862470075eab83bb398195f3d6" }
system-configuration = "0.2"
[target.'cfg(windows)'.dependencies]
diff --git a/talpid-core/src/tunnel/wireguard/config.rs b/talpid-core/src/tunnel/wireguard/config.rs
index a15f377165..ff167edb7c 100644
--- a/talpid-core/src/tunnel/wireguard/config.rs
+++ b/talpid-core/src/tunnel/wireguard/config.rs
@@ -50,7 +50,7 @@ impl Config {
wg_options: &wireguard::TunnelOptions,
generic_options: &GenericTunnelOptions,
) -> Result<Config> {
- ensure!(peers.is_empty(), ErrorKind::NoPeersSuppliedError);
+ ensure!(!peers.is_empty(), ErrorKind::NoPeersSuppliedError);
let mtu = wg_options.mtu.unwrap_or(DEFAULT_MTU);
let is_ipv6_enabled = mtu >= SMALLEST_IPV6_MTU && generic_options.enable_ipv6;
@@ -61,7 +61,7 @@ impl Config {
.cloned()
.filter(|ip| ip.is_ipv4() || is_ipv6_enabled)
.collect();
- ensure!(peer.allowed_ips.is_empty(), ErrorKind::InvalidPeerIpError);
+ ensure!(!peer.allowed_ips.is_empty(), ErrorKind::InvalidPeerIpError);
}
tunnel.addresses = tunnel
@@ -69,7 +69,10 @@ impl Config {
.into_iter()
.filter(|ip| ip.is_ipv4() || is_ipv6_enabled)
.collect();
- ensure!(tunnel.addresses.is_empty(), ErrorKind::InvalidTunnelIpError);
+ ensure!(
+ !tunnel.addresses.is_empty(),
+ ErrorKind::InvalidTunnelIpError
+ );
Ok(Config {
tunnel,