diff --git a/switch/src/handle/punch_handler.rs b/switch/src/handle/punch_handler.rs index 67b7107..a09b791 100644 --- a/switch/src/handle/punch_handler.rs +++ b/switch/src/handle/punch_handler.rs @@ -249,7 +249,7 @@ async fn res_symmetric_handle_loop( } match tokio::time::timeout(Duration::from_secs(30), receiver.recv()).await { Ok(_) => {} - Err(e) => {} + Err(_e) => {} } loop { tokio::select! { diff --git a/switch/src/handle/udp_recv_handler.rs b/switch/src/handle/udp_recv_handler.rs index 832e66a..3b3e891 100644 --- a/switch/src/handle/udp_recv_handler.rs +++ b/switch/src/handle/udp_recv_handler.rs @@ -32,7 +32,7 @@ pub async fn udp_recv_start( udp: UdpSocket, server_addr: SocketAddr, other_sender: Sender<(SocketAddr, Vec)>, - mut tun_writer: TunWriter, + tun_writer: TunWriter, current_device: CurrentDeviceInfo, stop_fn: F, ) where @@ -275,7 +275,7 @@ fn other_handle( } Protocol::Control => { match ControlPacket::new(net_packet.transport_protocol(), net_packet.payload())? { - ControlPacket::PingPacket(ping) => { + ControlPacket::PingPacket(_ping) => { net_packet.set_transport_protocol(control_packet::Protocol::Pong.into()); udp.send_to(&net_packet.buffer()[..12], peer_addr)?; } diff --git a/switch/src/tun_device/mac.rs b/switch/src/tun_device/mac.rs index a20f1a2..3d9f232 100644 --- a/switch/src/tun_device/mac.rs +++ b/switch/src/tun_device/mac.rs @@ -1,11 +1,11 @@ -use std::io; -use std::io::{Error, Read, Write}; + + use std::net::Ipv4Addr; -use std::os::unix::process::CommandExt; + use std::process::Command; -use bytes::BufMut; -use tun::platform::posix::{Reader, Writer}; + + use tun::Device; use crate::tun_device::{TunReader, TunWriter};