diff options
| author | Remi NGUYEN VAN <reminv@google.com> | 2020-12-04 04:12:18 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-12-04 04:12:18 +0000 |
| commit | 6a1cb6207877c542cd3d42866b8fd9449aaff48c (patch) | |
| tree | 094f4141209c6be93cd7a9f83a81319d0f4f3c1b /core/java | |
| parent | 3e28c9d2425c55fa098e56bf2d91823d054a52c3 (diff) | |
| parent | 8f85ecd1f539898006cee952f043a26990e5780d (diff) | |
Merge "Use IPV6_MIN_MTU from NetworkConstants in Ikev2Vpn" am: 75304108e7 am: 8f85ecd1f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512879
Change-Id: I516719d803ccd2b4cda91eb38ecd108babab50b8
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/net/Ikev2VpnProfile.java | 15 | ||||
| -rw-r--r-- | core/java/android/net/LinkProperties.java | 3 |
2 files changed, 6 insertions, 12 deletions
diff --git a/core/java/android/net/Ikev2VpnProfile.java b/core/java/android/net/Ikev2VpnProfile.java index c8ca618e5969..63fc5f288e61 100644 --- a/core/java/android/net/Ikev2VpnProfile.java +++ b/core/java/android/net/Ikev2VpnProfile.java @@ -16,12 +16,9 @@ package android.net; -import static android.net.PlatformVpnProfile.TYPE_IKEV2_IPSEC_PSK; -import static android.net.PlatformVpnProfile.TYPE_IKEV2_IPSEC_RSA; -import static android.net.PlatformVpnProfile.TYPE_IKEV2_IPSEC_USER_PASS; - import static com.android.internal.annotations.VisibleForTesting.Visibility; import static com.android.internal.util.Preconditions.checkStringNotEmpty; +import static com.android.net.module.util.NetworkStackConstants.IPV6_MIN_MTU; import android.annotation.NonNull; import android.annotation.Nullable; @@ -158,9 +155,8 @@ public final class Ikev2VpnProfile extends PlatformVpnProfile { // IPv6 MTU is greater; since profiles may be started by the system on IPv4 and IPv6 // networks, the VPN must provide a link fulfilling the stricter of the two conditions // (at least that of the IPv6 MTU). - if (mMaxMtu < LinkProperties.MIN_MTU_V6) { - throw new IllegalArgumentException( - "Max MTU must be at least" + LinkProperties.MIN_MTU_V6); + if (mMaxMtu < IPV6_MIN_MTU) { + throw new IllegalArgumentException("Max MTU must be at least" + IPV6_MIN_MTU); } switch (mType) { @@ -811,9 +807,8 @@ public final class Ikev2VpnProfile extends PlatformVpnProfile { // IPv6 MTU is greater; since profiles may be started by the system on IPv4 and IPv6 // networks, the VPN must provide a link fulfilling the stricter of the two conditions // (at least that of the IPv6 MTU). - if (mtu < LinkProperties.MIN_MTU_V6) { - throw new IllegalArgumentException( - "Max MTU must be at least " + LinkProperties.MIN_MTU_V6); + if (mtu < IPV6_MIN_MTU) { + throw new IllegalArgumentException("Max MTU must be at least " + IPV6_MIN_MTU); } mMaxMtu = mtu; return this; diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java index 06046f7ded2e..0941e7dbed17 100644 --- a/core/java/android/net/LinkProperties.java +++ b/core/java/android/net/LinkProperties.java @@ -81,8 +81,7 @@ public final class LinkProperties implements Parcelable { private static final int MIN_MTU = 68; - /** @hide */ - public static final int MIN_MTU_V6 = 1280; + private static final int MIN_MTU_V6 = 1280; private static final int MAX_MTU = 10000; |
