aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tunnel
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2019-06-05 10:42:50 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-06-07 11:31:53 +0200
commitec841c480f6ea7b8aff7768a14b24f55988c6e25 (patch)
treea3aac23172ffb13a9024df8984f7ba840107f83d /tunnel
parentui: get rid of hacks in tunnelspage (diff)
downloadwireguard-windows-ec841c480f6ea7b8aff7768a14b24f55988c6e25.tar.xz
wireguard-windows-ec841c480f6ea7b8aff7768a14b24f55988c6e25.zip
tunnel: perform full stop on shutdown
The services which do not advertise they accept shutdown signal from SCM are killed on shutdown. This commit establishes a full tunnel cleanup (i.e. delete the adapter) on shutdown. Otherwise, the Wintun adapter is deleted on next boot as a part of the regular sanitation procedure. Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to '')
-rw-r--r--tunnel/service.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/tunnel/service.go b/tunnel/service.go
index dbf0dd6e..5c1cc13e 100644
--- a/tunnel/service.go
+++ b/tunnel/service.go
@@ -211,14 +211,14 @@ func (service *Service) Execute(args []string, r <-chan svc.ChangeRequest, chang
}
}()
- changes <- svc.Status{State: svc.Running, Accepts: svc.AcceptStop}
+ changes <- svc.Status{State: svc.Running, Accepts: svc.AcceptStop | svc.AcceptShutdown}
log.Println("Startup complete")
for {
select {
case c := <-r:
switch c.Cmd {
- case svc.Stop:
+ case svc.Stop, svc.Shutdown:
return
case svc.Interrogate:
changes <- c.CurrentStatus