diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-03-01 17:17:32 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-03-01 17:17:32 +0100 |
commit | cffd24910b1cd67e8387cc5e12c62fdd7a6479c7 (patch) | |
tree | 1c9df38b5a87a9e69c9df3e767b3599b1fc08a90 /service/service_tunnel.go | |
parent | ifaceconfig: separate out from tunnel service file (diff) | |
download | wireguard-windows-cffd24910b1cd67e8387cc5e12c62fdd7a6479c7.tar.xz wireguard-windows-cffd24910b1cd67e8387cc5e12c62fdd7a6479c7.zip |
ifaceconfig: allow for null defaults
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'service/service_tunnel.go')
-rw-r--r-- | service/service_tunnel.go | 10 |
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} |