tun win fix warning

This commit is contained in:
asxalex 2024-10-25 11:19:46 +08:00
parent cb71c53102
commit c4c1f109b1

View File

@ -15,7 +15,7 @@ use wintun;
use crate::get_edge;
use crate::network::{
generate_arp_request, send_arp_request, send_packet_to_net, ArpHdr, ArpRequestInfo,
ArpResponse, ARP_REPLY,
ArpResponse, ARP_REPLY, ARP_REQUEST,
};
use crate::pb::{encode_to_udp_message, SdlData};
use crate::tcp::PacketType;
@ -102,7 +102,7 @@ impl TunTapPacketHandler for Iface {
error!("payload length error");
return Ok(());
}
let crc_code = &rest[(rest.len() - 4)..rest.len()];
// let crc_code = &rest[(rest.len() - 4)..rest.len()];
// let rest = &rest[..(rest.len() - 4)];
@ -200,7 +200,7 @@ impl TunTapPacketHandler for Iface {
.await;
}
}
other => {
_other => {
println!("unknown arp type info");
}
}
@ -217,7 +217,7 @@ impl TunTapPacketHandler for Iface {
send_arp_request(ArpRequestInfo::Set { ip, mac }).await;
}
}
Err(e) => {
Err(_) => {
error!("failed to parse ip header, dropping");
return Ok(());
}