Commit Graph

6902 Commits

Author SHA1 Message Date
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
Junyu Lai
1e518579a8 Merge changes Ibff278a6,If6d537a3 am: 5cb924da73
am: 6c6580aa4f

Change-Id: Ic51f3b32375378ff74bdd54d1f36569b277fc80f
2019-05-09 23:30:19 -07: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
c161521c15 [automerger skipped] Merge "DO NOT MERGE - Merge Pie Bonito/Sargo into master." am: b4da895ce0 -s ours
am: a50f7a2fb3 -s ours
am skip reason: subject contains skip directive

Change-Id: I27cf7d7b751417bac1087a3778e012076c0e66c6
2019-05-09 17:57:48 -07:00
Xiao Ma
015598ea52 adopt non-blocking method to obtain the IpMemoryStore service.
Bug: 131133347
Test: atest FrameworksNetTests
Merged-In: I7de4f23370bdf9c9df5e74ed074c794080d93d95
Merged-In: If0d43f21710ca31149610d3e6a5f0d7e4acc11a2

Change-Id: If0d43f21710ca31149610d3e6a5f0d7e4acc11a2
(cherry picked from commit c4e4fd7beeda36c84548c7bb4a16312f20bdf188)
2019-05-10 00:55:14 +00:00
Xin Li
036efcc5c5 [automerger skipped] DO NOT MERGE - Merge Pie Bonito/Sargo into master. am: 82e787f227 -s ours
am: 00a98876ad -s ours
am skip reason: subject contains skip directive

Change-Id: I862d40111b2e525e5838bf09e169c8c3f416633b
2019-05-09 17:16:31 -07: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
6f9be90965 Merge "Clean up the keepalive slots when network disconnect" am: 192f09d63e
am: 56001c90c8

Change-Id: Id3e4e159713c0ed7e03f45169e87b73ae6408e4f
2019-05-09 13:24:32 -07: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
42f6be8b40 Merge "adopt non-blocking method to obtain the IpMemoryStore service." am: 14b9e8b6d8
am: 042800ead0

Change-Id: If0d43f21710ca31149610d3e6a5f0d7e4acc11a2
2019-05-09 04:55:13 -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
Lorenzo Colitti
2c95b3740f [automerger skipped] Merge "[CS] Unregister callback as part of onUnavailable dispatch" into qt-dev
am: 80045d35e7 -s ours
am skip reason: change_id I4c54b003a733eb0b1e4fd8674ed13081b1bef8e3 with SHA1 6cb6599ddd is in history

Change-Id: I3a61f64da1fc5d376da06a81ce8a35bac09d4481
2019-05-09 02:57:25 -07:00
Lorenzo Colitti
80045d35e7 Merge "[CS] Unregister callback as part of onUnavailable dispatch" into qt-dev 2019-05-09 09:42:38 +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
abc0036a8b Merge "[CS] Unregister callback as part of onUnavailable dispatch" am: e2ba92c411
am: 477211720f

Change-Id: Ida684c441e7aaedce9a29da071ef5a68403d08b3
2019-05-08 22:42:55 -07: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
Lorenzo Colitti
65365f4320 Merge "Add IPsec checks for IPSEC_TUNNEL feature" into qt-dev
am: 44d474d7c7

Change-Id: I9bd0fa3958c63a148af98abfe7cc6e4301cf01c2
2019-05-08 21:20:19 -07:00
Etan Cohen
2f9a465841 [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
Merged-In: I4c54b003a733eb0b1e4fd8674ed13081b1bef8e3
Change-Id: I4c54b003a733eb0b1e4fd8674ed13081b1bef8e3
2019-05-09 03:57:54 +00: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
Benedict Wong
d7be3aa1d2 Add IPsec checks for IPSEC_TUNNEL feature
This patch adds checks to ensure that the IPSEC_TUNNEL feature flag is
enabled.

Bug: 117183273
Test: Compiles & tests passing
Change-Id: I2699dda29e1eed139bc6fd1b70071e5ab33cad88
2019-05-08 00:11:28 +00:00
Android Build Merger (Role)
0a723f38a8 Merge changes into qt-dev-plus-aosp 2019-05-07 22:19:43 +00: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
Luke Huang
f32e134dfc Merge "Correct buffer size limitation for DnsResolver API" into qt-dev
am: 87d2f6c929

Change-Id: I4be2688872c9cc3e2e136144ecd45db7ec2e54bf
2019-05-06 22:39:37 -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
53578de5d1 Correct buffer size limitation for DnsResolver API
Bug: 131055651
Test: atest DnsResolverTest
(cherry picked from commit f6726c2c5456887aaebe3f821a86a83bbed92f3d)

Change-Id: I69ad9428ddfb70437e47ef4740930a97aece69d9
2019-05-02 09:37:13 +00:00
Paul Hu
454cf032a8 Add CTS API coverage for APIs which are used by NetworkStack
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

Change-Id: I0fed0664c1eb7b07c890efffb71ef589f65eec80
Merged-In: Id3f0d1c19a76c7987b69e449203fc50423f5e531
Merged-In: I0fed0664c1eb7b07c890efffb71ef589f65eec80
(cherry picked from commit 8c6a07de57680d7d2db75fada3e3ab04c27fa62f)
2019-05-02 08:44:46 +00:00
Luke Huang
26052432e3 Merge "Correct buffer size limitation for DnsResolver API" am: c586bdf976
am: 7077ae7361

Change-Id: If779ada4dbc1e67b28067235f5055d7f94692c69
2019-05-01 23:39:32 -07: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