From f8b117007b47c1a2663b348a04aa1160e251caeb Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Thu, 8 Dec 2022 11:29:39 +0800 Subject: [PATCH] fix: tun create panic --- listener/listener.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/listener/listener.go b/listener/listener.go index 5d7b98c2..d747d5f5 100644 --- a/listener/listener.go +++ b/listener/listener.go @@ -532,7 +532,12 @@ func ReCreateTun(tunConf LC.Tun, tcpIn chan<- C.ConnContext, udpIn chan<- C.Pack return } - tunLister, err = sing_tun.New(tunConf, tcpIn, udpIn) + lister, err := sing_tun.New(tunConf, tcpIn, udpIn) + if err != nil { + return + } + tunLister = lister + log.Infoln("[TUN] Tun adapter listening at: %s", tunLister.Address()) }