From ac539ace70957fec2cbd3bc5a33d721c5257c19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 6 Sep 2022 19:30:12 +0800 Subject: [PATCH] Add system tun stack --- inbound/tun.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/inbound/tun.go b/inbound/tun.go index 3b304db0..1b3534ab 100644 --- a/inbound/tun.go +++ b/inbound/tun.go @@ -144,7 +144,17 @@ func (t *Tun) Start() error { return E.Cause(err, "configure tun interface") } t.tunIf = tunIf - t.tunStack, err = tun.NewStack(t.ctx, t.stack, tunIf, t.tunOptions.MTU, t.endpointIndependentNat, t.udpTimeout, t) + t.tunStack, err = tun.NewStack(t.stack, tun.StackOptions{ + Context: t.ctx, + Tun: tunIf, + MTU: t.tunOptions.MTU, + Name: t.tunOptions.Name, + Inet4Address: t.tunOptions.Inet4Address, + Inet6Address: t.tunOptions.Inet6Address, + EndpointIndependentNat: t.endpointIndependentNat, + UDPTimeout: t.udpTimeout, + Handler: t, + }) if err != nil { return err }