From 03151cc90ebfaeec1a232c852a3a9c7778f4b5f1 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 4 Jul 2026 15:20:10 +0800 Subject: [PATCH] in tun, should .await in eee.device.send --- src/network/tun_linux.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/network/tun_linux.rs b/src/network/tun_linux.rs index ae694d5..58dd34e 100755 --- a/src/network/tun_linux.rs +++ b/src/network/tun_linux.rs @@ -443,14 +443,15 @@ impl TunTapPacketHandler for Iface { arp.sipaddr = [((self_ip >> 16) & 0xffff) as u16, (self_ip & 0xffff) as u16]; - let mut data_buf = BytesMut::from(arp.marshal_to_bytes().as_slice()); - let encryptor = edge.encryptor.load(); - if let Err(e) = encryptor.encrypt(&mut data_buf) { - error!("failed to encrypt arp reply: {:?}", e); - return Ok(()); - } + let mut data_buf = + BytesMut::from(arp.marshal_to_bytes().as_slice()); + let encryptor = edge.encryptor.load(); + if let Err(e) = encryptor.encrypt(&mut data_buf) { + error!("failed to encrypt arp reply: {:?}", e); + return Ok(()); + } - let data_bytes = data_buf.freeze(); + let data_bytes = data_buf.freeze(); let data = SdlData { is_p2p: true, @@ -523,7 +524,7 @@ impl TunTapPacketHandler for Iface { // println!("got ip packet"); // println!("got data: {:?}", rest); - match edge.device.send(rest) { + match edge.device.send(rest).await { Ok(size) => { debug!("send to tun {} bytes", size); }