Merge pull request #493 from rookisbusy/Alpha

fix: tun warn timeout
This commit is contained in:
gVisor bot 2023-04-09 19:03:10 +08:00
commit bf0bdfbf7d

View file

@ -6,6 +6,7 @@ import (
"io" "io"
"net" "net"
"net/netip" "net/netip"
"os"
"sync" "sync"
"time" "time"
@ -117,7 +118,8 @@ func (h *ListenerHandler) NewPacketConnection(ctx context.Context, conn network.
dest, err := conn.ReadPacket(buff) dest, err := conn.ReadPacket(buff)
if err != nil { if err != nil {
buff.Release() buff.Release()
if E.IsClosed(err) { // ignore simple error
if err == os.ErrDeadlineExceeded || E.IsClosed(err) {
break break
} }
return err return err