>();
let in_ips = config.in_ips.split(" ").into_iter().filter(|e| !e.is_empty()).map(|e| e.to_string()).collect();
let in_ips = match ips_parse(&in_ips) {
diff --git a/switch-desktop/ui/index.html b/switch-desktop/ui/index.html
index 341702e..1086c31 100644
--- a/switch-desktop/ui/index.html
+++ b/switch-desktop/ui/index.html
@@ -99,7 +99,7 @@
#add-div-in {
padding: 30px;
- height: 380px;
+ height: 410px;
width: 580px;
position: relative;
background-color: #fff;
@@ -364,7 +364,7 @@
+ value="nat1.wherewego.top:35061,nat1.wherewego.top:35062,nat2.wherewego.top:35061,nat2.wherewego.top:35062">
diff --git a/switch/src/handle/tun_tap/tun_handler.rs b/switch/src/handle/tun_tap/tun_handler.rs
index 03bfaa1..7b5abcf 100644
--- a/switch/src/handle/tun_tap/tun_handler.rs
+++ b/switch/src/handle/tun_tap/tun_handler.rs
@@ -89,6 +89,8 @@ async fn start_(sender: ChannelSender,
return Ok(());
}
let len = device_reader.read(&mut buf[12..])? + 12;
+ #[cfg(any(target_os = "macos"))]
+ let mut buf = &mut buf;
match handle(&sender, &mut buf, len, device_writer, &igmp_server, current_device.load(), &ip_route, &ip_proxy_map, &cipher).await {
Ok(_) => {}
Err(e) => {
diff --git a/switch/src/tun_tap_device/mac.rs b/switch/src/tun_tap_device/mac.rs
index a9874fc..8fd9b07 100644
--- a/switch/src/tun_tap_device/mac.rs
+++ b/switch/src/tun_tap_device/mac.rs
@@ -88,7 +88,7 @@ pub fn create_device(device_type: DeviceType,
fn add_route(name: &str, address: Ipv4Addr, netmask: Ipv4Addr) -> io::Result<()> {
let route_add_str: String = format!(
- "sudo route -n add -net {:?}/{:?} -interface {}",
+ "route -n add {} -netmask {} -interface {}",
address, netmask, name
);
let route_add_out = Command::new("sh")