Commit Graph

4592 Commits

Author SHA1 Message Date
Hugo Benichi
7e26739b71 Merge changes I303d1102,I72c9aa43,If13a5284 am: c2023317e1 am: c460b26969
am: db410b1864

Change-Id: Iad1030a22f25bed92bd9d504fb1a40fc1e1cfdc5
2018-01-30 01:55:28 +00:00
Hugo Benichi
db410b1864 Merge changes I303d1102,I72c9aa43,If13a5284 am: c2023317e1
am: c460b26969

Change-Id: Ida5f28fc0e8e99199ac7129a6e3df0fbe864d90b
2018-01-30 01:47:07 +00:00
Hugo Benichi
c460b26969 Merge changes I303d1102,I72c9aa43,If13a5284
am: c2023317e1

Change-Id: I402de7fe5fc0e9bf56dc42f4c956c511baee78ab
2018-01-30 01:41:23 +00:00
Hugo Benichi
c2023317e1 Merge changes I303d1102,I72c9aa43,If13a5284
* changes:
  Fix default network validation overcounting
  Prevent crash in NetworkManagementServiceTest#shutdown()
  Fix ApfTest
2018-01-30 00:26:31 +00:00
Hugo Benichi
5da8769252 Fix default network validation overcounting
When switching from a validated default network to a new validated
default network (typically because of a better score),
DefaultNetworkMetrics would not reset the last validation timestamp.

This would cause the new default network to have a total recorded
validation time overcounted by the validation time of the previous
default network.

The following fix should be applied downstream for consumers of
previously recorded data:

  validation_time = min validation_time, duration_time);

Test: runtest -x frameworks/base/tests/net/../IpConnectivityMetricsTest
Change-Id: I303d11023527c19435f5f5e796a0295ae3f76d9f
2018-01-29 16:07:33 +09:00
Hugo Benichi
14fb2003c2 Prevent crash in NetworkManagementServiceTest#shutdown()
The shutdown method in NetworkManagementServiceTest was trying to close
the local socket on the test side, causing the NativeDaemonConnector
internal to NetworkManagementService to sometime crash due to the
output stream on NetworkManagementService side to throw on pending
reads.

The correct fix would be to shutdown the NativeDaemonConnector
inside NetworkManagementService and implement NetworkManagementService's
shutdown method, however there is no way to cleanly close a
NativeDaemonConnector.

Instead, this patch doesn't do any cleanup of the listening socket, the
test local socket, and its output stream. These objects' resources get
eventually collected by the system when the test process exits.

Test: runtest frameworks-net
Change-Id: I72c9aa43403754b55e9d23bf4f3ba8b7b4a3e10a
2018-01-29 16:01:56 +09:00
Chalard Jean
dcee2505b9 Merge "Fix a bug where a NetworkAgent gets repeatedly torn down" am: 20028ab529 am: 626e9681f2
am: 2b57bd040d

Change-Id: I06a64bbfaa501f860d7078cb2cc6d9af60b57eb8
2018-01-25 07:51:11 +00:00
Chalard Jean
2b57bd040d Merge "Fix a bug where a NetworkAgent gets repeatedly torn down" am: 20028ab529
am: 626e9681f2

Change-Id: Ifd63fdf47348dc3a1c1871deacc61470784bdbb6
2018-01-25 07:41:44 +00:00
Chalard Jean
626e9681f2 Merge "Fix a bug where a NetworkAgent gets repeatedly torn down"
am: 20028ab529

Change-Id: Ic37c9f60448b10c861a78848bed18ebd4e0ad910
2018-01-25 07:33:35 +00:00
Chalard Jean
20028ab529 Merge "Fix a bug where a NetworkAgent gets repeatedly torn down" 2018-01-25 05:37:21 +00:00
Chalard Jean
6b20130fd1 Fix a bug where a NetworkAgent gets repeatedly torn down
mUids is not marshalled correctly when null so if the
NetworkAgent runs in another process and is not a VPN then
the system will see its allowed Uids as being the empty
list (= nobody can use this network) instead of a null
list (= everybody can use this network). This breaks
emulator networking.

Bug: 72436966
Test: runtests frameworks-net
Test: also manual testing, this does fix emulator networking
      and seems not to break phone networking
Cherry-pick of : Id2bbf3808e80b19cd055c832c11cf72372710942

Change-Id: I4b88d5eccbdea745a947d12635cd751e38632589
2018-01-25 13:57:51 +09:00
Chalard Jean
7fc5aa063b Fix a bug where a NetworkAgent gets repeatedly torn down
mUids is not marshalled correctly when null so if the
NetworkAgent runs in another process and is not a VPN then
the system will see its allowed Uids as being the empty
list (= nobody can use this network) instead of a null
list (= everybody can use this network). This breaks
emulator networking.

Bug: 72436966
Test: runtests frameworks-net
Test: also manual testing, this does fix emulator networking
      and seems not to break phone networking
Change-Id: Id2bbf3808e80b19cd055c832c11cf72372710942
2018-01-25 04:51:44 +00:00
TreeHugger Robot
629834919c Merge "Determine the multipath hint from data usage." 2018-01-25 03:49:19 +00:00
Nathan Harold
f18642935a Merge changes from topic "keepalive-on-cell"
* changes:
  Rework KeepalivePacketData for Compatibility with Cell
  Add Constants for NATT Keepalive to RILConstants
  Relocate KeepalivePacketData to frameworks/base
2018-01-25 00:48:43 +00:00
Benedict Wong
31e9738f74 Merge "Add tunnel-mode calls to netd in IpSecService" am: 475fe28c50 am: 130409d40b
am: 0a64c3711a

Change-Id: I998d44bac0993a8f2e9e228a0b0a80adfaa4d87e
2018-01-24 20:07:20 +00:00
Benedict Wong
0a64c3711a Merge "Add tunnel-mode calls to netd in IpSecService" am: 475fe28c50
am: 130409d40b

Change-Id: I8a3d16c8e58ad1c09d967943abe1c729fe37636a
2018-01-24 19:56:24 +00:00
Benedict Wong
130409d40b Merge "Add tunnel-mode calls to netd in IpSecService"
am: 475fe28c50

Change-Id: I60bd2cd453b8ea7b5a0fb5eb0b59e8a9fe8f57cb
2018-01-24 19:48:26 +00:00
Nathan Harold
0976351a93 Rework KeepalivePacketData for Compatibility with Cell
KeepalivePacketData currently mixes multiple concepts: the
list of parameters that are used to generate a keepalive
packet, the keepalive packet itself, and the parameters that
are needed to send a keepalive packet over an ethernet link.

The KeepalivePacketData is now a parcelable that can be used
generically by any NetworkAgent, regardless of how that Agent
fulfills its duty to initiate and maintain a keepalive session.

Bug: 69063212
Test: verified with SL4A, additional tests pending
Change-Id: I23dc4827ae729583356a8ff0f02e39a2ad2b81f5
2018-01-24 11:13:19 -08:00
Nathan Harold
d66a0cd656 Relocate KeepalivePacketData to frameworks/base
Due to an issue resolving the boot classpath, the
KeepalivePacketData structure cannot be referenced
by frameworks/opt/telephony while it is in services.

-Move KeepalivePacketData to android.net
-Also, relocate IpUtils without changing the package
 name.

Bug: 38350389
Test: compilation
Change-Id: If5fc63e9ad8b9b2d4c2fee47ff4bab2ab190a05a
(cherry picked from commit bd4093be7cab51d6ad031854324134a9c8637c2c)
2018-01-24 10:26:04 -08:00
Lorenzo Colitti
7e5a145741 Determine the multipath hint from data usage.
Bug: 35142602
Test: builds, boots
Change-Id: I0f5de5e313ead442aa210f163db035fcf7de5e73
2018-01-25 01:25:09 +09:00
Benedict Wong
ad10de3acb Merge "Add TunnelInterface API and KernelResourceRecords" am: eb2ff56abe am: c5fb7341b1
am: 4157627bbd

Change-Id: I955d5090171f08e4fa20eac5bdfe761132b87d35
2018-01-24 09:54:06 +00:00
Benedict Wong
595bebada9 Merge "Add xfrm mark in IpSecConfig" am: 5bee154c8c am: 8950ec7e38
am: 201b229a4f

Change-Id: Ibaee9700cc6befdf6bbdb792cb673611e571d19a
2018-01-24 09:48:25 +00:00
Benedict Wong
4157627bbd Merge "Add TunnelInterface API and KernelResourceRecords" am: eb2ff56abe
am: c5fb7341b1

Change-Id: If27d78708ce225a900ad78a82d9f323770223808
2018-01-24 09:02:56 +00:00
Benedict Wong
c5fb7341b1 Merge "Add TunnelInterface API and KernelResourceRecords"
am: eb2ff56abe

Change-Id: Ic8a93b2d6d8280c01808968251e6f422fa1d2340
2018-01-24 08:55:38 +00:00
Benedict Wong
d32b02cf69 Add tunnel-mode calls to netd in IpSecService
Adds calls to relevant netd methods in IpSecService, enabling Tunnel
mode functionality.

Bug: 63588681
Test: Compiles, passing CTS + unit tests
Change-Id: I6deb68584cddb03f21bd76370d4ef69cadc1bf16
2018-01-24 08:19:55 +00:00
Benedict Wong
201b229a4f Merge "Add xfrm mark in IpSecConfig" am: 5bee154c8c
am: 8950ec7e38

Change-Id: I03ddca0611c4e0b41edc705cdb39b415205bb14b
2018-01-24 08:19:16 +00:00
Benedict Wong
8950ec7e38 Merge "Add xfrm mark in IpSecConfig"
am: 5bee154c8c

Change-Id: Idcac0878b4f74c25ef007fb7f1643fca5de80225
2018-01-24 08:00:52 +00:00
Benedict Wong
eb2ff56abe Merge "Add TunnelInterface API and KernelResourceRecords" 2018-01-24 07:25:04 +00:00
Benedict Wong
b8421d7772 Add TunnelInterface API and KernelResourceRecords
This change adds one KernelResourceRecord type (TunnelInterfaceRecord),
and adds methods for the creation of TunnelInterfaces, as well as the
application of Transforms to the given TunnelInterfaces

As part of the generation of ikeys/okeys, a ReserveKeyTracker manages a
java bitset to avoid collisions and reserve/release keys.

Bug: 63588681
Test: Compiles, CTS, unit tests all pass on AOSP_marlin
Change-Id: I9e9b6455e27073acd4491eae666aa966b3b10e0f
2018-01-24 07:24:27 +00:00
Chalard Jean
2f8889613d Resolve merge conflicts of aedd67b6cc to master
Test: this is the exact code these changes were meant to give
      without conflict had the auto-merger not squashed them
      together before it tried to merge them. It was tested on
      master in this state.

Change-Id: I5cbde17fb6016e5e6b5d0b04c8f41858d708ef4a
2018-01-24 15:59:26 +09:00
Chalard Jean
aedd67b6cc Merge changes I3b16caad,Iaf5ea7ab,I09a94042,I69a39039,I35300309, ... am: a890570df4
am: 643cb7cfd7

Change-Id: I3f2185330789a8b02cc5e05912e3f17256ba1b86
2018-01-24 06:11:06 +00:00
Chalard Jean
643cb7cfd7 Merge changes I3b16caad,Iaf5ea7ab,I09a94042,I69a39039,I35300309, ...
am: a890570df4

Change-Id: I49269ac65138be59d68561ea1c15ff2ad0339d8b
2018-01-24 06:03:41 +00:00
Benedict Wong
5bee154c8c Merge "Add xfrm mark in IpSecConfig" 2018-01-24 05:53:29 +00:00
Chenbo Feng
81afdba301 Merge changes from topic "bpfStats" am: 8eb249c775 am: 84968fc944
am: 4ddda41111

Change-Id: I672efa1221e17d0962ca5702330fc83d75fcac81
2018-01-24 05:46:52 +00:00
Chenbo Feng
4ddda41111 Merge changes from topic "bpfStats" am: 8eb249c775
am: 84968fc944

Change-Id: Ib4790159fd331858ce9f3343a44ccec66fae638c
2018-01-24 05:39:54 +00:00
Chenbo Feng
84968fc944 Merge changes from topic "bpfStats"
am: 8eb249c775

Change-Id: I488be110cca66990f44f6e45d5489ce23f36432e
2018-01-24 05:32:34 +00:00
Chalard Jean
a890570df4 Merge changes I3b16caad,Iaf5ea7ab,I09a94042,I69a39039,I35300309, ...
* changes:
  Let network requests see VPNs.
  Move constants into a new file.
  Make sure listen requests from VPN apps see their own networks
  Add a test for new UID checking code.
  Remove UID_RANGES_ADDED and REMOVED.
  Move VPN allowed UIDs into NetworkCapabilities.
  Pre-import to remove a conflict.
2018-01-24 04:09:44 +00:00
Treehugger Robot
8eb249c775 Merge changes from topic "bpfStats"
* changes:
  Use /proc/net/dev to get stats summary
  Add bpf support for NetworkStatsFactory
  Add BPF support for NetworkStatsService
2018-01-24 04:08:29 +00:00
Benedict Wong
9af66a7141 Merge "Add checks to ensure SPIs are not reused" am: 1f232690c3 am: f6ef9e335b
am: 12296836ba

Change-Id: I13738ac37710ec7934998ef269681ae7c41c612e
2018-01-23 20:40:39 +00:00
Lorenzo Colitti
5be5eb2070 Merge changes from topic "multipath-datausage-backport" am: 61fe8317c7 am: f131243d63
am: 2a014f3e42  -s ours

Change-Id: Ib16c50de2a3846dae9736e7ca68a4282831f0812
2018-01-23 20:20:53 +00:00
Lorenzo Colitti
8e71036c1d Disable IpConnectivityMetricsTest. am: ddf729bb8d am: a4e89a3cd8
am: b3e79a4f5d  -s ours

Change-Id: Ie9b63bf66eee676568e7262350033dbb286c04c4
2018-01-23 20:10:13 +00:00
Benedict Wong
12296836ba Merge "Add checks to ensure SPIs are not reused" am: 1f232690c3
am: f6ef9e335b

Change-Id: I8c7243bc600e5f2e9abec03b5a357ed6376aa9bf
2018-01-23 19:55:47 +00:00
Lorenzo Colitti
2a014f3e42 Merge changes from topic "multipath-datausage-backport" am: 61fe8317c7
am: f131243d63

Change-Id: I45f0c69e3440e9ec69c82e81c41bea682a359389
2018-01-23 19:43:13 +00:00
Lorenzo Colitti
b3e79a4f5d Disable IpConnectivityMetricsTest. am: ddf729bb8d
am: a4e89a3cd8

Change-Id: Ic5a24e40ce126bc872281bb353706a245eb345f2
2018-01-23 19:33:27 +00:00
Benedict Wong
f6ef9e335b Merge "Add checks to ensure SPIs are not reused"
am: 1f232690c3

Change-Id: I893925014557e5ae13303debc4ee8f50faf9605d
2018-01-23 19:27:51 +00:00
Lorenzo Colitti
f131243d63 Merge changes from topic "multipath-datausage-backport"
am: 61fe8317c7

Change-Id: Ic29d71ade161434b6dea796a887f60b5587ca1d5
2018-01-23 19:17:54 +00:00
Lorenzo Colitti
a4e89a3cd8 Disable IpConnectivityMetricsTest.
am: ddf729bb8d

Change-Id: Iba9dad4001c6aa725285eee6df32f116c846532d
2018-01-23 19:04:05 +00:00
Benedict Wong
1f232690c3 Merge "Add checks to ensure SPIs are not reused" 2018-01-23 18:00:06 +00:00
Lorenzo Colitti
61fe8317c7 Merge changes from topic "multipath-datausage-backport"
* changes:
  Support passing a template to NetworkStatsManager queries.
  Add metered, roaming, and defaultNetwork info to NetworkTemplate.
  Unbreak frameworks-net tests broken by missing libutilscallstack.
  Disable IpConnectivityMetricsTest.
  Add the defaultNetwork element to the netstats.proto.
  Add getDefaultNetwork to the NetworkStats public API.
2018-01-23 15:22:18 +00:00
Ricky Wai
e0f3f68a26 Merge "Add ConnectivityManager.getNetworkWatchlistConfigHash()" 2018-01-23 14:25:39 +00:00