From a4804eb8ad5f1c1d09e5ca768c3d4c8fa4252742 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Wed, 3 Apr 2024 23:32:25 +0800 Subject: [PATCH] fix: close mixed stack panic #1014 --- listener/sing_tun/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/listener/sing_tun/server.go b/listener/sing_tun/server.go index 384ff016b5..aeeca77443 100644 --- a/listener/sing_tun/server.go +++ b/listener/sing_tun/server.go @@ -261,7 +261,8 @@ func New(options LC.Tun, tunnel C.Tunnel, additions ...inbound.Addition) (l *Lis } } l.tunIf = tunIf - l.tunStack, err = tun.NewStack(strings.ToLower(options.Stack.String()), stackOptions) + + tunStack, err := tun.NewStack(strings.ToLower(options.Stack.String()), stackOptions) if err != nil { return } @@ -270,6 +271,7 @@ func New(options LC.Tun, tunnel C.Tunnel, additions ...inbound.Addition) (l *Lis if err != nil { return } + l.tunStack = tunStack //l.openAndroidHotspot(tunOptions)