aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tunnel
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-08-09 22:44:15 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-08-09 23:39:31 +0200
commit36d14fc7806c0bbdfebf0b169dd1361b9e0bed47 (patch)
tree2e04946d9f20082efbf158822e1aae38c75da6ea /tunnel
parentdriver: split 64bit arguments into two for 32bit machines (diff)
downloadwireguard-windows-36d14fc7806c0bbdfebf0b169dd1361b9e0bed47.tar.xz
wireguard-windows-36d14fc7806c0bbdfebf0b169dd1361b9e0bed47.zip
embeddable-dll-service: use wgnt always
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tunnel')
-rw-r--r--tunnel/service.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/tunnel/service.go b/tunnel/service.go
index 14264193..fc3c0f07 100644
--- a/tunnel/service.go
+++ b/tunnel/service.go
@@ -34,6 +34,12 @@ type tunnelService struct {
Path string
}
+// Escape hatch to let the embeddable-dll-service force an implementation.
+// 0 - use the registry key
+// 1 - use the kernel driver
+// 2 - use wireguard-go
+var ForceImplementation = 0
+
func (service *tunnelService) Execute(args []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (svcSpecificEC bool, exitCode uint32) {
changes <- svc.Status{State: svc.StartPending}
@@ -163,7 +169,7 @@ func (service *tunnelService) Execute(args []string, r <-chan svc.ChangeRequest,
}
log.Println("Creating network adapter")
- if conf.AdminBool("ExperimentalKernelDriver") {
+ if ForceImplementation == 1 || (ForceImplementation == 0 && conf.AdminBool("ExperimentalKernelDriver")) {
// Does an adapter with this name already exist?
adapter, err = driver.DefaultPool.OpenAdapter(config.Name)
if err == nil {