Merge "Do not disconnect existing VPN if seamless handover fails"

This commit is contained in:
Rubin Xu
2019-05-09 12:49:40 +00:00
committed by Gerrit Code Review

View File

@@ -1141,7 +1141,11 @@ public class Vpn {
}
} catch (RuntimeException e) {
IoUtils.closeQuietly(tun);
agentDisconnect();
// If this is not seamless handover, disconnect partially-established network when error
// occurs.
if (oldNetworkAgent != mNetworkAgent) {
agentDisconnect();
}
// restore old state
mConfig = oldConfig;
mConnection = oldConnection;