From a9839abd4cbfad497274db4e41566f9d1cb45092 Mon Sep 17 00:00:00 2001 From: wwqgtxx 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()) }