From af78c5d86cc584100eb71da9d8ce19800de25d60 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 1 Mar 2019 17:17:32 +0100 Subject: ifaceconfig: allow for null defaults --- service/service_tunnel.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'service/service_tunnel.go') 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} -- cgit v1.2.3-59-g8ed1b