Skip to content

Commit

Permalink
Address Brian's review
Browse files Browse the repository at this point in the history
  • Loading branch information
goodhoko committed Sep 13, 2024
1 parent 7664887 commit 954dba0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wireguard-control/src/backends/userspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ fn get_userspace_implementation() -> String {
}

fn start_userspace_wireguard(iface: &InterfaceName) -> io::Result<Output> {
let mut command = Command::new(get_userspace_implementation());
let userspace_implementation = get_userspace_implementation();
let mut command = Command::new(&userspace_implementation);

let output_res = if cfg!(target_os = "linux") {
command.args(&[iface.to_string()]).output()
Expand All @@ -294,7 +295,7 @@ fn start_userspace_wireguard(iface: &InterfaceName) -> io::Result<Output> {
},
Err(e) if e.kind() == io::ErrorKind::NotFound => Err(io::Error::new(
io::ErrorKind::NotFound,
"Cannot find \"wireguard-go\". Specify a custom path with WG_USERSPACE_IMPLEMENTATION.",
format!("Cannot find \"{userspace_implementation}\". Specify a custom path with WG_USERSPACE_IMPLEMENTATION."),
)),
Err(e) => Err(e),
}
Expand Down

0 comments on commit 954dba0

Please sign in to comment.