fix(wireguard): fix detection of kernelspace wireguard

This commit is contained in:
Quentin McGaw
2026-01-20 15:40:59 +00:00
parent 9b9b723887
commit fba60af772
10 changed files with 31 additions and 62 deletions
+1 -6
View File
@@ -16,7 +16,6 @@ import (
)
var (
ErrDetectKernel = errors.New("cannot detect Kernel support")
ErrCreateTun = errors.New("cannot create TUN device")
ErrAddLink = errors.New("cannot add Wireguard link")
ErrFindLink = errors.New("cannot find link")
@@ -35,11 +34,7 @@ var (
// See https://git.zx2c4.com/wireguard-go/tree/main.go
func (w *Wireguard) Run(ctx context.Context, waitError chan<- error, ready chan<- struct{}) {
kernelSupported, err := w.netlink.IsWireguardSupported()
if err != nil {
waitError <- fmt.Errorf("%w: %s", ErrDetectKernel, err)
return
}
kernelSupported := w.netlink.IsWireguardSupported()
setupFunction := setupUserSpace
switch w.settings.Implementation {