From 81a996ec1d9739c723badfd5b4f73e20ed9257c4 Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Sun, 9 Apr 2023 19:00:45 +0800 Subject: [PATCH] fix: tun warn timeout --- listener/sing_tun/dns.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/listener/sing_tun/dns.go b/listener/sing_tun/dns.go index f2daaf0c..e5ec82e2 100644 --- a/listener/sing_tun/dns.go +++ b/listener/sing_tun/dns.go @@ -6,6 +6,7 @@ import ( "io" "net" "net/netip" + "os" "sync" "time" @@ -117,7 +118,8 @@ func (h *ListenerHandler) NewPacketConnection(ctx context.Context, conn network. dest, err := conn.ReadPacket(buff) if err != nil { buff.Release() - if E.IsClosed(err) { + // ignore simple error + if err == os.ErrDeadlineExceeded || E.IsClosed(err) { break } return err