KernelModuleDisablerPreference: turn off tunnels before switching backend

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2020-03-09 16:18:55 -06:00
parent 492fcce053
commit d55fb25a40
2 changed files with 26 additions and 11 deletions
@@ -247,7 +247,7 @@ public final class TunnelManager extends BaseObservable {
});
}
CompletionStage<State> setTunnelState(final ObservableTunnel tunnel, final State state) {
public CompletionStage<State> setTunnelState(final ObservableTunnel tunnel, final State state) {
// Ensure the configuration is loaded before trying to use it.
return tunnel.getConfigAsync().thenCompose(config ->
Application.getAsyncWorker().supplyAsync(() -> Application.getBackend().setState(tunnel, state, config))