OSDN Git Service

Support strict mode private DNS on VPNs that provide Internet.
authorLorenzo Colitti <lorenzo@google.com>
Fri, 10 May 2019 11:33:43 +0000 (04:33 -0700)
committerLorenzo Colitti <lorenzo@google.com>
Wed, 11 Dec 2019 11:19:40 +0000 (20:19 +0900)
commit029d9ea11921b7ca5652d24a9563b66c2b70fafc
tree1e62f9996e5322146bd38488367b10a46636f029
parent60cd85533d3a9ad4e3758de4804d1716e7fe0371
Support strict mode private DNS on VPNs that provide Internet.

Currently, strict mode private DNS does not work on VPNs because
NetworkMonitor does not validate VPNs. When a VPN connects, it
immediately transitions to ValidatedState, skipping private DNS
hostname resolution.

This change makes NetworkMonitor perform private DNS hostname
resolution and evaluation even on VPNs.

In order to ensure that the system always immediately switches to
the VPN as soon as it connects, remove the unvalidated penalty
for VPN networks. This ensures that the VPN score is always 101
and the VPN always outscores other networks as soon as it
connects. Previously, it would only outscore other networks
when no-op validation completed.

Backport of 414b8c8b1ce8ae2ad6ef95c1ffba19062077d3e6.

Bug: 122652057
Test: atest FrameworksNetTests
Test: manually ran a VPN with private DNS in strict mode
Test: atest android.net.cts.ConnectivityManagerTest com.android.cts.net.HostsideVpnTests
Change-Id: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
Merged-In: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
services/core/java/com/android/server/ConnectivityService.java
services/core/java/com/android/server/connectivity/ConnectivityConstants.java
services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
services/core/java/com/android/server/connectivity/NetworkMonitor.java
tests/net/java/com/android/server/ConnectivityServiceTest.java