Merge changes from topic "ikeparams-api-change" am: eabf5d707c
Change-Id: I867ee35f13f20a557bda343092229b3630f970cc
This commit is contained in:
@@ -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());
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user