Merge changes from topic "ikeparams-api-change" am: eabf5d707c

Change-Id: I867ee35f13f20a557bda343092229b3630f970cc
This commit is contained in:
Automerger Merge Worker
2020-03-02 17:44:42 +00:00
2 changed files with 4 additions and 7 deletions

View File

@@ -2353,10 +2353,11 @@ public class Vpn {
// TODO: Remove the need for adding two unused addresses with // TODO: Remove the need for adding two unused addresses with
// IPsec tunnels. // IPsec tunnels.
final InetAddress address = InetAddress.getLocalHost();
mTunnelIface = mTunnelIface =
mIpSecManager.createIpSecTunnelInterface( mIpSecManager.createIpSecTunnelInterface(
ikeSessionParams.getServerAddress() /* unused */, address /* unused */,
ikeSessionParams.getServerAddress() /* unused */, address /* unused */,
network); network);
mNetd.setInterfaceUp(mTunnelIface.getInterfaceName()); mNetd.setInterfaceUp(mTunnelIface.getInterfaceName());

View File

@@ -85,16 +85,12 @@ import java.util.List;
public class VpnIkev2Utils { public class VpnIkev2Utils {
static IkeSessionParams buildIkeSessionParams( static IkeSessionParams buildIkeSessionParams(
@NonNull Context context, @NonNull Ikev2VpnProfile profile, @NonNull Network network) { @NonNull Context context, @NonNull Ikev2VpnProfile profile, @NonNull Network network) {
// TODO(b/149356682): Update this based on new IKE API. Only numeric addresses supported
// until then. All others throw IAE (caught by caller).
final InetAddress serverAddr = InetAddresses.parseNumericAddress(profile.getServerAddr());
final IkeIdentification localId = parseIkeIdentification(profile.getUserIdentity()); final IkeIdentification localId = parseIkeIdentification(profile.getUserIdentity());
final IkeIdentification remoteId = parseIkeIdentification(profile.getServerAddr()); final IkeIdentification remoteId = parseIkeIdentification(profile.getServerAddr());
// TODO(b/149356682): Update this based on new IKE API.
final IkeSessionParams.Builder ikeOptionsBuilder = final IkeSessionParams.Builder ikeOptionsBuilder =
new IkeSessionParams.Builder(context) new IkeSessionParams.Builder(context)
.setServerAddress(serverAddr) .setServerHostname(profile.getServerAddr())
.setNetwork(network) .setNetwork(network)
.setLocalIdentification(localId) .setLocalIdentification(localId)
.setRemoteIdentification(remoteId); .setRemoteIdentification(remoteId);