Skip to content

Commit

Permalink
Use NetworkManager to create a WireGuard device
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkisemils committed Nov 24, 2020
1 parent 125c7f4 commit e214bd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions README.md
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions talpid-core/src/tunnel/wireguard/mod.rs
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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"
)
);
}
Expand Down

0 comments on commit e214bd6

Please sign in to comment.