aboutsummaryrefslogtreecommitdiffstats
path: root/src/platform/linux/tun.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-12-03 21:49:08 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-12-03 21:49:08 +0100
commit5a7f762d6ce6b5bbdbd10f5966adc909597f37d6 (patch)
treeb53fa0c1ee02c1e211d6cf94c6ba0334135ec42e /src/platform/linux/tun.rs
parentClose socket fd after getmtu ioctl (diff)
downloadwireguard-rs-5a7f762d6ce6b5bbdbd10f5966adc909597f37d6.tar.xz
wireguard-rs-5a7f762d6ce6b5bbdbd10f5966adc909597f37d6.zip
Moving away from peer threads
Diffstat (limited to '')
-rw-r--r--src/platform/linux/tun.rs24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/platform/linux/tun.rs b/src/platform/linux/tun.rs
index 2bac49f..39b9320 100644
--- a/src/platform/linux/tun.rs
+++ b/src/platform/linux/tun.rs
@@ -359,31 +359,9 @@ impl PlatformTun for LinuxTun {
// create PlatformTunMTU instance
Ok((
- vec![LinuxTunReader { fd }], // TODO: enable multi-queue for Linux
+ vec![LinuxTunReader { fd }], // TODO: use multi-queue for Linux
LinuxTunWriter { fd },
LinuxTunStatus::new(req.name)?,
))
}
}
-
-#[cfg(test)]
-mod tests {
- use super::*;
- use std::env;
-
- fn is_root() -> bool {
- match env::var("USER") {
- Ok(val) => val == "root",
- Err(_) => false,
- }
- }
-
- #[test]
- fn test_tun_create() {
- if !is_root() {
- return;
- }
- let (readers, writers, mtu) = LinuxTun::create("test").unwrap();
- // TODO: test (any good idea how?)
- }
-}