mirror of
https://github.com/qdm12/gluetun.git
synced 2026-06-12 15:22:24 +02:00
fix(wireguard): skip tun device checks when using kernelspace
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
"github.com/qdm12/gluetun/internal/netlink"
|
||||
"github.com/qdm12/gluetun/internal/provider"
|
||||
"github.com/qdm12/gluetun/internal/tun"
|
||||
"github.com/qdm12/gluetun/internal/wireguard"
|
||||
"github.com/qdm12/gosettings"
|
||||
)
|
||||
@@ -19,6 +20,11 @@ func setupAmneziaWg(ctx context.Context, netlinker NetLinker,
|
||||
settings settings.VPN, ipv6SupportLevel netlink.IPv6SupportLevel, logger wireguard.Logger) (
|
||||
amneziawger *amneziawg.Amneziawg, connection models.Connection, err error,
|
||||
) {
|
||||
err = tun.Setup()
|
||||
if err != nil {
|
||||
return nil, models.Connection{}, fmt.Errorf("setting up tun device: %w", err)
|
||||
}
|
||||
|
||||
ipv6Internet := ipv6SupportLevel == netlink.IPv6Internet
|
||||
connection, err = providerConf.GetConnection(settings.Provider.ServerSelection, ipv6Internet)
|
||||
if err != nil {
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/qdm12/gluetun/internal/netlink"
|
||||
"github.com/qdm12/gluetun/internal/openvpn"
|
||||
"github.com/qdm12/gluetun/internal/provider"
|
||||
"github.com/qdm12/gluetun/internal/tun"
|
||||
)
|
||||
|
||||
// setupOpenVPN sets OpenVPN up using the configurators and settings given.
|
||||
@@ -18,6 +19,11 @@ func setupOpenVPN(ctx context.Context, fw Firewall,
|
||||
settings settings.VPN, ipv6SupportLevel netlink.IPv6SupportLevel, starter Cmder,
|
||||
logger openvpn.Logger) (runner *openvpn.Runner, connection models.Connection, err error,
|
||||
) {
|
||||
err = tun.Setup()
|
||||
if err != nil {
|
||||
return nil, models.Connection{}, fmt.Errorf("setting up tun device: %w", err)
|
||||
}
|
||||
|
||||
ipv6Internet := ipv6SupportLevel == netlink.IPv6Internet
|
||||
connection, err = providerConf.GetConnection(settings.Provider.ServerSelection, ipv6Internet)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user