aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/service/service_tunnel.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-03-01 17:17:32 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-01 17:17:32 +0100
commitaf78c5d86cc584100eb71da9d8ce19800de25d60 (patch)
tree1c9df38b5a87a9e69c9df3e767b3599b1fc08a90 /service/service_tunnel.go
parentifaceconfig: separate out from tunnel service file (diff)
downloadwireguard-windows-af78c5d86cc584100eb71da9d8ce19800de25d60.tar.xz
wireguard-windows-af78c5d86cc584100eb71da9d8ce19800de25d60.zip
ifaceconfig: allow for null defaults
Diffstat (limited to '')
-rw-r--r--service/service_tunnel.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/service/service_tunnel.go b/service/service_tunnel.go
index 02be70aa..750a4302 100644
--- a/service/service_tunnel.go
+++ b/service/service_tunnel.go
@@ -7,11 +7,9 @@ package service
import (
"bufio"
- "encoding/binary"
"fmt"
"log"
"strings"
- "unsafe"
"golang.org/x/sys/windows/svc"
"golang.org/x/sys/windows/svc/debug"
@@ -44,12 +42,6 @@ type tunnelService struct {
debug bool
}
-func htonl(val uint32) uint32 {
- bytes := make([]byte, 4)
- binary.BigEndian.PutUint32(bytes, val)
- return *(*uint32)(unsafe.Pointer(&bytes[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}
@@ -140,7 +132,7 @@ func (service *tunnelService) Execute(args []string, r <-chan svc.ChangeRequest,
}
ipcSetOperation(device, bufio.NewReader(strings.NewReader(uapiConf)))
- err = bindSocketToMonitoredDefault(device.net.bind.(*NativeBind))
+ err = monitorDefaultRoutes(device.net.bind.(*NativeBind))
if err != nil {
logger.Error.Println("Unable to bind sockets to default route:", err)
changes <- svc.Status{State: svc.StopPending}