mirror of
https://github.com/passepartoutvpn/wireguard-apple.git
synced 2025-02-16 21:02:02 +00:00
TunnelsManager: Fix race between multiple startActivation() calls
After startActivate() is called on a waiting tunnel, user might turn on a different tunnel before the waiting tunnel's status gets updated. This fix prevents that from happening.
This commit is contained in:
parent
872bda6d34
commit
20a23a86da
@ -392,6 +392,8 @@ class TunnelContainer: NSObject {
|
||||
|
||||
wg_log(.debug, message: "startActivation: Entering (tunnel: \(self.name))")
|
||||
|
||||
self.status = .activating // Ensure that no other tunnel can attempt activation until this tunnel is done trying
|
||||
|
||||
guard tunnelProvider.isEnabled else {
|
||||
// In case the tunnel had gotten disabled, re-enable and save it,
|
||||
// then call this function again.
|
||||
|
Loading…
Reference in New Issue
Block a user