From ffb49ba4c55a1924f06133c9539efbdcc275e49e Mon Sep 17 00:00:00 2001 From: Meta Date: Mon, 25 Apr 2022 18:21:50 +0800 Subject: [PATCH] fix: gvisor panic --- listener/tun/ipstack/gvisor/tcp.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/listener/tun/ipstack/gvisor/tcp.go b/listener/tun/ipstack/gvisor/tcp.go index 61f5d90e..a045d056 100644 --- a/listener/tun/ipstack/gvisor/tcp.go +++ b/listener/tun/ipstack/gvisor/tcp.go @@ -67,6 +67,10 @@ func withTCPHandler(handle adapter.TCPHandleFunc) option.Option { defer r.Complete(false) err = setSocketOptions(s, ep) + if err != nil { + r.Complete(true) + return + } conn := &tcpConn{ TCPConn: gonet.NewTCPConn(&wq, ep),