From 175686b193ebbe6095d6117a35412ba7aa23f08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20L=C3=B6nnhager?= Date: Fri, 30 Aug 2024 19:29:46 +0200 Subject: [PATCH] Set tunnel name to wg0-mullvad for wireguard-go --- CHANGELOG.md | 1 + talpid-tunnel/src/tun_provider/unix.rs | 3 +++ talpid-wireguard/src/wireguard_kernel/mod.rs | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37fbe8822bc3..aced86fe5798 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ Line wrap the file at 100 chars. Th ### Fixed - macOS and Linux: Fix potential crash when disconnecting with DAITA enabled. +- Set tunnel name to `wg0-mullvad` when userspace WireGuard is enabled. #### macOS - Exclude programs when executed using a relative path from a shell. diff --git a/talpid-tunnel/src/tun_provider/unix.rs b/talpid-tunnel/src/tun_provider/unix.rs index 640af527b31c..31b77ba4c986 100644 --- a/talpid-tunnel/src/tun_provider/unix.rs +++ b/talpid-tunnel/src/tun_provider/unix.rs @@ -8,6 +8,8 @@ use std::{ }; use tun::{platform, Configuration, Device}; +const MULLVAD_INTERFACE_NAME: &str = "wg0-mullvad"; + /// Errors that can occur while setting up a tunnel device. #[derive(Debug, thiserror::Error)] pub enum Error { @@ -129,6 +131,7 @@ impl TunnelDevice { #[allow(unused_mut)] pub fn new() -> Result { let mut config = Configuration::default(); + config.name(MULLVAD_INTERFACE_NAME); #[cfg(target_os = "linux")] config.platform(|config| { diff --git a/talpid-wireguard/src/wireguard_kernel/mod.rs b/talpid-wireguard/src/wireguard_kernel/mod.rs index a3c053acfc07..2d8c166d35a1 100644 --- a/talpid-wireguard/src/wireguard_kernel/mod.rs +++ b/talpid-wireguard/src/wireguard_kernel/mod.rs @@ -84,7 +84,7 @@ pub enum Error { NetworkManager(#[source] nm_tunnel::Error), } -pub(crate) const MULLVAD_INTERFACE_NAME: &str = "wg0-mullvad"; +const MULLVAD_INTERFACE_NAME: &str = "wg0-mullvad"; #[derive(Debug)] pub struct Handle {