From 73a2c318549da80f43adb77792b43daa53d75150 Mon Sep 17 00:00:00 2001 From: lubeilin <1791778603@qq.com> Date: Sun, 24 Sep 2023 13:42:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=80=9A=E8=BF=87=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=90=8C=E6=97=B6=E5=85=B3=E9=97=ADtap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnt/src/handle/tun_tap/tap_handler.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vnt/src/handle/tun_tap/tap_handler.rs b/vnt/src/handle/tun_tap/tap_handler.rs index 9dd6d7f..97b0309 100644 --- a/vnt/src/handle/tun_tap/tap_handler.rs +++ b/vnt/src/handle/tun_tap/tap_handler.rs @@ -139,6 +139,9 @@ fn start_simple( ) -> io::Result<()> { let mut buf = [0; 4096]; loop { + if sender.is_close() { + return Ok(()); + } let len = device_reader.read(&mut buf)?; if let Err(e) = handle( &mut buf,