[mio] 兼容mac
This commit is contained in:
@@ -5,11 +5,13 @@ use tun::device::IFace;
|
|||||||
use tun::Device;
|
use tun::Device;
|
||||||
|
|
||||||
use crate::core::Config;
|
use crate::core::Config;
|
||||||
|
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||||
const DEFAULT_TUN_NAME: &str = "vnt-tun";
|
const DEFAULT_TUN_NAME: &str = "vnt-tun";
|
||||||
|
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||||
const DEFAULT_TAP_NAME: &str = "vnt-tap";
|
const DEFAULT_TAP_NAME: &str = "vnt-tap";
|
||||||
|
|
||||||
pub fn create_device(config: &Config) -> io::Result<Arc<Device>> {
|
pub fn create_device(config: &Config) -> io::Result<Arc<Device>> {
|
||||||
|
#[cfg(any(target_os = "windows", target_os = "linux"))]
|
||||||
let default_name: &str = if config.tap {
|
let default_name: &str = if config.tap {
|
||||||
DEFAULT_TAP_NAME
|
DEFAULT_TAP_NAME
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user