summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEmīls <emils@mullvad.net>2020-11-23 15:09:57 +0000
committerEmīls <emils@mullvad.net>2020-11-24 16:39:14 +0000
commite214bd677af9945a2037b1330a2aca875179a03a (patch)
tree5f38e6666fd53ba9f466de33e80a75d53d5bb68e
parent125c7f48715dfeb75f7062d7b3d5685de0d7a159 (diff)
downloadmullvadvpn-e214bd677af9945a2037b1330a2aca875179a03a.tar.xz
mullvadvpn-e214bd677af9945a2037b1330a2aca875179a03a.zip
Use NetworkManager to create a WireGuard device
-rw-r--r--README.md4
-rw-r--r--talpid-core/src/tunnel/wireguard/mod.rs8
2 files changed, 4 insertions, 8 deletions
diff --git a/README.md b/README.md
index fcf17da5a2..d221784bfa 100644
--- a/README.md
+++ b/README.md
@@ -367,10 +367,6 @@ echo "org.gradle.jvmargs=-Xmx4608M" >> ~/.gradle/gradle.properties
* `TALPID_FORCE_USERSPACE_WIREGUARD` - Forces the daemon to use the userspace implementation of
WireGuard on Linux.
-* `TALPID_FORCE_NM_WIREGUARD` - Forces the daemon to use NetworkManager to create a WireGuard
- device instead of relying on netlink. This is highly inadvisable currently, as NetworkManager is
- exhibiting buggy behavior.
-
## Building and running the desktop Electron GUI app
diff --git a/talpid-core/src/tunnel/wireguard/mod.rs b/talpid-core/src/tunnel/wireguard/mod.rs
index 9b2633725c..3aa3d39c4c 100644
--- a/talpid-core/src/tunnel/wireguard/mod.rs
+++ b/talpid-core/src/tunnel/wireguard/mod.rs
@@ -153,7 +153,7 @@ impl WireguardMonitor {
) -> Result<Box<dyn Tunnel>> {
#[cfg(target_os = "linux")]
if !*FORCE_USERSPACE_WIREGUARD {
- if *FORCE_NM_WIREGUARD {
+ if crate::dns::will_use_nm() {
match wireguard_kernel::NetworkManagerTunnel::new(config) {
Ok(tunnel) => {
log::debug!("Using NetworkManager to use kernel WireGuard implementation");
@@ -163,12 +163,12 @@ impl WireguardMonitor {
log::error!(
"{}",
err.display_chain_with_msg(
- "Failed to initialize WireGuard tunnel via NetworkManager"
+ "Failed to initialize WireGuard tunnel via NetworkManager, will try netlink directly"
)
);
}
};
- } else if !crate::dns::will_use_nm() {
+ } else {
match wireguard_kernel::NetlinkTunnel::new(route_manager.runtime_handle(), config) {
Ok(tunnel) => {
log::debug!("Using kernel WireGuard implementation");
@@ -178,7 +178,7 @@ impl WireguardMonitor {
log::error!(
"{}",
error.display_chain_with_msg(
- "Failed to setup kernel WireGuard device, falling back to userspace"
+ "Failed to setup kernel WireGuard device, falling back to the userspace implementation"
)
);
}