Avoid cloning packet on receive apth

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2023-09-20 16:22:36 +02:00
parent 690eabe93c
commit 2db606d110
+1 -4
View File
@@ -228,10 +228,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
while let Some(packet) = tun_rx.recv().await {
trace!("received packet from tun_rx");
if let Err(e) = txhalf.send(packet.clone().into()).await {
error!(
"Failed to send packet on local TUN interface: {e} - {}",
faster_hex::hex_string(&packet)
);
error!("Failed to send packet on local TUN interface: {e}",);
continue;
}
trace!("Sent packet on tun interface");