From b7aacd3245450f5ecfaae76417feaa9d3e8559d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Fri, 1 Nov 2024 22:20:04 +0800 Subject: [PATCH] Wireguard inbound: Do not use kernel TUN (#3960) Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com> --- proxy/wireguard/config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/proxy/wireguard/config.go b/proxy/wireguard/config.go index e8a6630f..cbaa670b 100644 --- a/proxy/wireguard/config.go +++ b/proxy/wireguard/config.go @@ -31,8 +31,13 @@ func (c *DeviceConfig) fallbackIP6() bool { } func (c *DeviceConfig) createTun() tunCreator { + if !c.IsClient { + // See tun_linux.go createKernelTun() + errors.LogWarning(context.Background(), "Using gVisor TUN. WG inbound doesn't support kernel TUN yet.") + return createGVisorTun + } if c.NoKernelTun { - errors.LogWarning(context.Background(), "Using gVisor TUN.") + errors.LogWarning(context.Background(), "Using gVisor TUN. NoKernelTun is set to true.") return createGVisorTun } kernelTunSupported, err := KernelTunSupported()