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); }