diff --git a/cmd/ctrld_library/main.go b/cmd/ctrld_library/main.go index f1b17d1..49f5b26 100644 --- a/cmd/ctrld_library/main.go +++ b/cmd/ctrld_library/main.go @@ -61,8 +61,13 @@ func mapCallback(callback AppCallback) cli.AppCallback { } } -func (c *Controller) Stop(Pin int64) int { - errorCode := cli.CheckDeactivationPin(Pin, c.stopCh) +func (c *Controller) Stop(restart bool, pin int64) int { + var errorCode = 0 + // Force disconnect without checking pin. + // In iOS restart is required if vpn detects no connectivity after network change. + if !restart { + errorCode = cli.CheckDeactivationPin(pin, c.stopCh) + } if errorCode == 0 && c.stopCh != nil { close(c.stopCh) c.stopCh = nil