Commit Graph

6191 Commits

Author SHA1 Message Date
Xiao Ma
82a7e510a5 Merge "Clean up the arguments annotation and verify items on IpMemoryStoreTest."
am: 3bee1cdc4e

Change-Id: Ifbd359f9fec530076f3216c171120436ed4221a6
2019-05-10 08:33:48 -07:00
Xiao Ma
3bee1cdc4e Merge "Clean up the arguments annotation and verify items on IpMemoryStoreTest." 2019-05-10 15:16:33 +00:00
Aaron Huang
c72bc8eea1 Merge "Send message to add/remove NAT-T keepalive packet filter."
am: 29df9e7e8f

Change-Id: I3e35d73a38cfbd0a29ad3f1f859b2d6fdb514ff1
2019-05-10 07:19:27 -07:00
Aaron Huang
29df9e7e8f Merge "Send message to add/remove NAT-T keepalive packet filter." 2019-05-10 13:57:11 +00:00
Chalard Jean
e3950cf24a Merge "Support strict mode private DNS on VPNs that provide Internet."
am: 9db77747a6

Change-Id: I6522706917731a944483ad3cb9cdbc20447be6c2
2019-05-10 03:58:01 -07:00
Chalard Jean
9db77747a6 Merge "Support strict mode private DNS on VPNs that provide Internet." 2019-05-10 09:39:17 +00:00
Paul Hu
5574b26c8e Merge "Add LinkProperties common test cases"
am: 78415c34f4

Change-Id: I8f856d3851458e2a3f32034c9b9e1395123e0f89
2019-05-10 01:18:33 -07:00
Junyu Lai
278e66a401 Merge changes Ibcb91105,I0218f367
am: 6a5c545890

Change-Id: I4972d42657aa118e17240546c223723ed7b546ec
2019-05-10 01:14:05 -07:00
paulhu
73f8eca8ad Add ApfCapabilities common test cases
Bug: 129199900
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases: added tests pass
Change-Id: I0c2aeaa1451e1f07edb0d0f8529e42e6fa107a6d
2019-05-10 16:03:42 +08:00
Xiao Ma
103a7ce029 Clean up the arguments annotation and verify items on IpMemoryStoreTest.
Bug: 131133347
Test: atest FrameworksNetTests
Change-Id: I371e7b637ab1c2671f0378508b06adff174f024d
2019-05-10 15:42:33 +09:00
Paul Hu
78415c34f4 Merge "Add LinkProperties common test cases" 2019-05-10 05:55:11 +00:00
Junyu Lai
6a5c545890 Merge changes Ibcb91105,I0218f367
* changes:
  Limit unprivileged keepalives per uid
  Support customization of supported keepalive count per transport
2019-05-10 05:47:23 +00:00
Lorenzo Colitti
2fca7e3cb3 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.

Bug: 122652057
Test: atest FrameworksNetTests NetworkStackTests
Test: manually ran a VPN with private DNS in strict mode
atest android.net.cts.ConnectivityManagerTest com.android.cts.net.HostsideVpnTests
Change-Id: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
2019-05-10 14:30:54 +09:00
Junyu Lai
6c6580aa4f Merge changes Ibff278a6,If6d537a3
am: 5cb924da73

Change-Id: If1d215b0fae85bfeeb5b6190abf4e4dc841912e5
2019-05-09 21:32:10 -07:00
Treehugger Robot
5cb924da73 Merge changes Ibff278a6,If6d537a3
* changes:
  Revert "Add NATT keepalive resources and methods into IpSecService"
  Revert "[KA11] Verify fd ownership and allocate resource for NattKeepalive"
2019-05-10 01:42:26 +00:00
Xin Li
a50f7a2fb3 [automerger skipped] Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master."
am: b4da895ce0 -s ours
am skip reason: subject contains skip directive

Change-Id: Id9cffb46751533cdd19a71577bf4dddea6219ddb
2019-05-09 16:46:13 -07:00
Xin Li
00a98876ad [automerger skipped] DO NOT MERGE - Merge Pie Bonito/Sargo into master.
am: 82e787f227 -s ours
am skip reason: subject contains skip directive

Change-Id: Ib109cf35cae4b70ac762f9f3d4951968cfa91e9e
2019-05-09 15:56:19 -07:00
Xin Li
b4da895ce0 Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master." 2019-05-09 22:05:45 +00:00
Junyu Lai
56001c90c8 Merge "Clean up the keepalive slots when network disconnect"
am: 192f09d63e

Change-Id: I2cedf5752d37f96337ab69d94534cb7745e8efa3
2019-05-09 12:29:16 -07:00
Junyu Lai
192f09d63e Merge "Clean up the keepalive slots when network disconnect" 2019-05-09 18:53:03 +00:00
junyulai
782e216494 Clean up the keepalive slots when network disconnect
In general, keepalive slots are released after result of
stopping has returned. However, for network disconnect case,
the service side cannot communicate with network agent since
the async channel is broken.

Clean up keepalive slots right after stop in this case.

Bug: 132341736
Test: 1. atest com.android.server.ConnectivityServiceTest \
         #testNattSocketKeepalives --generate-new-metrics 100
      2. atest FrameworksNetTests --generate-new-metrics 10

Change-Id: Ia30741f71fa72fc117e071976fd73991fa3c9535
2019-05-09 17:16:17 +00:00
Junyu Lai
b4864e6c40 Revert "Add NATT keepalive resources and methods into IpSecService"
This reverts commit bdf7048571.

Reason for revert: Adds dependency between IpSecService and
                   ConnectivityService may lead to future deadlock
		   problems. Uses a simpler approach instead,
		   hence the solution is not needed.
		   See aosp/954040.

Change-Id: Ibff278a6eee666cd85dba81c2bed94d568679b02
2019-05-10 00:58:18 +08:00
junyulai
0586a60292 Limit unprivileged keepalives per uid
Public APIs for creating unprivileged NATT socket keepalive
might allow users to exhaust resource if malicious apps try
to create keepalives with fd which is not created by
IpSecService through binder call. Thus, this change add
customizable limitation per uid to prevent resource exhaustion
attack.

Bug: 129371366
Bug: 132307230
Test: atest FrameworksNetTests
Change-Id: Ibcb91105e46f7e898b8aa7c2babc3344ef2c6257
2019-05-10 00:36:58 +08:00
junyulai
4dca18aa31 Support customization of supported keepalive count per transport
This change specifies the required minimum supported keepalives
in SDK, and allows OEMs to customize supported keepalive count
per network through resource overlay.

Bug: 129371366
Test: 1. m -j doc-comment-check-docs
      2. atest FrameworksNetTests

Change-Id: I0218f3674628c13ead63fc9a873895ba7f113033
2019-05-10 00:36:58 +08:00
Xin Li
82e787f227 DO NOT MERGE - Merge Pie Bonito/Sargo into master.
Bug: 131756210
Change-Id: I77a701deda4935526ad452564f9bda77af345f46
2019-05-09 09:27:04 -07:00
Xiao Ma
042800ead0 Merge "adopt non-blocking method to obtain the IpMemoryStore service."
am: 14b9e8b6d8

Change-Id: Idd6110141795f86dcf28eafab87683eda4c70b93
2019-05-09 04:43:33 -07:00
Xiao Ma
14b9e8b6d8 Merge "adopt non-blocking method to obtain the IpMemoryStore service." 2019-05-09 11:30:56 +00:00
paulhu
9f7636c722 Add LinkProperties common test cases
Bug: 129198747
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases: added tests pass
Change-Id: I15b8dbd060c313d0f2be89fed4518c18b3196d38
2019-05-09 15:49:00 +08:00
Etan Cohen
477211720f Merge "[CS] Unregister callback as part of onUnavailable dispatch"
am: e2ba92c411

Change-Id: I14d3c0f6c606020bd1d1e756174a66ee933cb15f
2019-05-08 22:13:00 -07:00
Etan Cohen
e2ba92c411 Merge "[CS] Unregister callback as part of onUnavailable dispatch" 2019-05-09 03:57:29 +00:00
Etan Cohen
6cb6599ddd [CS] Unregister callback as part of onUnavailable dispatch
The onUnavailable semantics promise that it is equivalent to calling
the unregister callback method. But - it doesn't unregister the callback
allowing it to be reused. Fixed.

Additionally, modified the unregisterNetworkCallback method to not fail
on duplicate unregistration (since a callback could now self
unregister). Instead simply print a log.

Bug: 130651445
Test: atest ConnectivityServiceTest
Change-Id: I4c54b003a733eb0b1e4fd8674ed13081b1bef8e3
2019-05-09 02:41:40 +00:00
Xiao Ma
afc8845452 adopt non-blocking method to obtain the IpMemoryStore service.
Test: atest FrameworksNetTests
Change-Id: I7de4f23370bdf9c9df5e74ed074c794080d93d95
2019-05-09 10:39:50 +09:00
Junyu Lai
d09adf6456 Revert "[KA11] Verify fd ownership and allocate resource for NattKeepalive"
This reverts commit 2bb85a0bc0.

Reason for revert: Adds dependency between IpSecService and
                   ConnectivityService may lead to future deadlock
                   problems. Uses a simpler approach instead,
                   hence the solution is not needed.
                   See aosp/954040.

Change-Id: If6d537a39595cf132d3ed81d4eaac6700f5f0ab3
2019-05-08 11:44:20 +08:00
android-build-team Robot
06427c1a55 Snap for 5450365 from 3852c74552 to pi-platform-release
Change-Id: I944e7d1ac9deebd68b7a3d2f3b8200df78a23099
2019-05-07 21:45:49 +00:00
Chenbo Feng
4737299d94 Clean up the permission control code in framework
Delete the unused NetworkManagementService API for set/remove
permissions. Use PERMISSION_NONE to replace NO_PERMISSIONS so the
framework now use the same set of permission constant when communicate
with netd.

Bug: 128944261
Test: PermissionMonitorTest.java

Change-Id: I25224c9576f52d2a0a0bd2182325c7aac7b28eb5
2019-05-07 13:50:25 -07:00
Aaron Huang
77abd94876 Send message to add/remove NAT-T keepalive packet filter.
Remove definition of TYPE_NATT and TYPE_TCP since the type
can be identified by checking message.obj is an instance of
NattKeepalivePacketData or TcpKeepalivePacketData.
It's more simple and won't have dependency on KeepaliveInfo.

Bug: 33530442
Test: atest FrameworksNetTests
      atest NetworkStackTests

Change-Id: Ic97ffe9ff5781778efd264460809f5059f0f4230
2019-05-06 19:52:48 +08:00
paulhu
a3a7c6ef67 Ignore NetworkTest when running CtsNetTestCases in instant app mode
Ignore NetworkTest#testBindSocketOfConnectedDatagramSocketThrows
when running CtsNetTestCases in instant app mode due to sockect
cannot bind in instant app mode.

Bug: 123366918
Test: atest CtsNetTestCases --instant
Test: atest FrameworksNetTests
Change-Id: I37e5988b36213a6f47b51a681db1cf2614041cee
2019-05-03 22:28:22 +08:00
Luke Huang
7077ae7361 Merge "Correct buffer size limitation for DnsResolver API"
am: c586bdf976

Change-Id: Ia9febf5f707c182d465e79ed8f4d80a4853c868f
2019-05-01 23:28:06 -07:00
Luke Huang
c586bdf976 Merge "Correct buffer size limitation for DnsResolver API" 2019-05-02 05:59:33 +00:00
Paul Hu
1e6c28a167 Merge "Add CTS API coverage for APIs which are used by NetworkStack"
am: ebf3945e1a

Change-Id: I33b58b69e906e5b90dfc7f0b512c81edd51b1684
2019-05-01 21:12:55 -07:00
Luke Huang
fbd8ecfe17 Correct buffer size limitation for DnsResolver API
Bug: 131055651
Test: atest DnsResolverTest
Change-Id: I29decd480172eacb452ccb0da524ef1bf2ffadcf
2019-05-02 11:48:54 +08:00
Paul Hu
ebf3945e1a Merge "Add CTS API coverage for APIs which are used by NetworkStack" 2019-05-02 01:37:26 +00:00
paulhu
e878a6c64f Add CTS API coverage for APIs which are used by NetworkStack
Change-Id: I4f6c34f3bcfa65e60cf73fc1b7cab2d83c32836a
Bug: 129200003
Bug: 129200292
Bug: 129199996
Bug: 129200261
Bug: 129200513
Bug: 129200316
Bug: 129200589
Bug: 129200181
Bug: 129200669
Bug: 129200504
Bug: 129200478
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases: added tests pass
2019-04-30 17:26:24 +08:00
Mark Chien
04bd7b864c Merge "Support adding NATT keepalive packet filter"
am: 7a571f5be4

Change-Id: I9618b519f4bd4d5f1edbcede3a3bd727110c2a7e
2019-04-29 09:17:46 -07:00
Mark Chien
7a571f5be4 Merge "Support adding NATT keepalive packet filter" 2019-04-29 15:59:16 +00:00
Paul Hu
a88e73d3ae Merge "Add Network, NetworkCapabilities, StaticIpConfiguration common test cases"
am: c049c59368

Change-Id: Id469ce450ac84d967ee19ecad44dae6905187a59
2019-04-29 08:50:18 -07:00
Paul Hu
c049c59368 Merge "Add Network, NetworkCapabilities, StaticIpConfiguration common test cases" 2019-04-29 15:38:48 +00:00
Aaron Huang
df1edb385c Support adding NATT keepalive packet filter
Support adding NATT keepalive packet filter to APF
filter.
Generating APF program will be addressed in another CL.

Bug: 33530442
Test: - atest NetworkStackTests
      - atest FrameworksNetTests

Change-Id: I4961d5da343d8700600269632787c28112f0f9f1
2019-04-29 19:33:45 +08:00
Mark Chien
0718febadc Merge "Add AIDL parcelable for NattKeepalivePacketData"
am: 781e7d163f

Change-Id: Idd5ff9d4d52064dbfe5df1e4677c41bcccd9c09a
2019-04-29 03:49:03 -07:00
Mark Chien
781e7d163f Merge "Add AIDL parcelable for NattKeepalivePacketData" 2019-04-29 10:26:35 +00:00