Commit graph

4,376 commits

Message SHA1
Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator"
am: 028e2a048e

Change-Id: If35e07b78b17329a25cf78adbf3d8244af4a4f81

Jong Wook Kim   authored and   android-build-merger   commited 2018-02-07 05:20:19 +00:00
c7ec0f6fc3
Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator"
Jong Wook Kim   authored and   Gerrit Code Review   commited 2018-02-07 02:06:07 +00:00
028e2a048e
MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator
Use SecureRandom instead of Random since Random is time based and can
increase the chance of generating same MAC address across multiple
devices.

createRandomUnicastAddress should randomize all bits of the address,
except for locally assigned bit and unicast bit. The previous method
that only randomizes NIC and use Google Base OUI is renamed to
createRandomUnicastAddressWithGoogleBase.

Bug: 72450936
Test: runtest frameworks-net
Change-Id: Icda650638c2c1c9fd90d509a87e86347c0e05f2d

Jong Wook Kim   commited 2018-02-07 01:28:46 +00:00
93dd5e6964
Merge "Frameworks: Mark tests"
am: 997937820d

Change-Id: I07af71812c623a14bd8df098e9991a331bdecbc2

Andreas Gampe   authored and   android-build-merger   commited 2018-02-06 09:04:38 +00:00
043d868185
Merge "Frameworks: Mark tests"
Treehugger Robot   authored and   Gerrit Code Review   commited 2018-02-06 06:03:09 +00:00
997937820d
Frameworks: Mark tests
Add @Ignore and @Test to make Errorprone happy.

Bug: 72076216
Test: m javac-check RUN_ERROR_PRONE=true
Test: atest ConnectivityServiceTest
Test: atest WifiManagerTest
Change-Id: Id2423c545eccaa768203faf86e14d0a558d927cd

Andreas Gampe   commited 2018-01-31 01:04:00 +00:00
3fa5c22fc8
Merge changes from topic "cherry-pick-cell-keepalive"
am: 7e8374e9fc

Change-Id: I3001cd2693b2c57643672fd7f370b5cca2890585

nharold   authored and   android-build-merger   commited 2018-01-30 19:41:53 +00:00
86362b4677
Merge changes from topic "cherry-pick-cell-keepalive"
* changes:
  Rework KeepalivePacketData for Compatibility with Cell
  Add Constants for NATT Keepalive to RILConstants
  Relocate KeepalivePacketData to frameworks/base

nharold   authored and   Gerrit Code Review   commited 2018-01-30 18:39:07 +00:00
7e8374e9fc
Merge changes I303d1102,I72c9aa43,If13a5284
am: 1aaf45bf89

Change-Id: I402de7fe5fc0e9bf56dc42f4c956c511baee78ab

Hugo Benichi   authored and   android-build-merger   commited 2018-01-30 01:41:23 +00:00
5001af80ff
Merge changes I303d1102,I72c9aa43,If13a5284
* changes:
  Fix default network validation overcounting
  Prevent crash in NetworkManagementServiceTest#shutdown()
  Fix ApfTest

Hugo Benichi   authored and   Gerrit Code Review   commited 2018-01-30 00:26:31 +00:00
1aaf45bf89
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
Merged-In: I23dc4827ae729583356a8ff0f02e39a2ad2b81f5
Change-Id: I23dc4827ae729583356a8ff0f02e39a2ad2b81f5
(cherry picked from commit 5be3f5a2b1)

Nathan Harold   commited 2018-01-29 11:20:20 -08:00
7f8d0be10d
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
Merged-In: If5fc63e9ad8b9b2d4c2fee47ff4bab2ab190a05a
Change-Id: If5fc63e9ad8b9b2d4c2fee47ff4bab2ab190a05a
(cherry picked from commit f8a2bc3eee)

Nathan Harold   commited 2018-01-29 11:19:43 -08:00
583c95be3b
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

Hugo Benichi   commited 2018-01-29 16:07:33 +09:00
11f04e863e
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

Hugo Benichi   commited 2018-01-29 16:01:56 +09:00
f78548d222
Merge "Fix a bug where a NetworkAgent gets repeatedly torn down"
am: f597b81b4e

Change-Id: Ic37c9f60448b10c861a78848bed18ebd4e0ad910

Chalard Jean   authored and   android-build-merger   commited 2018-01-25 07:33:35 +00:00
ca1ca2c465
Merge "Fix a bug where a NetworkAgent gets repeatedly torn down"
Chalard Jean   authored and   Gerrit Code Review   commited 2018-01-25 05:37:21 +00:00
f597b81b4e
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

Chalard Jean   commited 2018-01-25 04:51:44 +00:00
715d078639
Merge "Add tunnel-mode calls to netd in IpSecService"
am: 475fe28c50

Change-Id: I60bd2cd453b8ea7b5a0fb5eb0b59e8a9fe8f57cb

Benedict Wong   authored and   android-build-merger   commited 2018-01-24 19:48:26 +00:00
77189e8a86
Merge "Add TunnelInterface API and KernelResourceRecords"
am: 7a7d04e103

Change-Id: Ic8a93b2d6d8280c01808968251e6f422fa1d2340

Benedict Wong   authored and   android-build-merger   commited 2018-01-24 08:55:38 +00:00
7cacbb3c86
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

Benedict Wong   commited 2018-01-24 08:19:55 +00:00
859629fa0b
Merge "Add xfrm mark in IpSecConfig"
am: da7f993d34

Change-Id: Idcac0878b4f74c25ef007fb7f1643fca5de80225

Benedict Wong   authored and   android-build-merger   commited 2018-01-24 08:00:52 +00:00
6829dd8442
Merge "Add TunnelInterface API and KernelResourceRecords"
Benedict Wong   authored and   Gerrit Code Review   commited 2018-01-24 07:25:04 +00:00
7a7d04e103
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

Benedict Wong   commited 2018-01-24 07:24:27 +00:00
145b425fac
Merge changes I3b16caad,Iaf5ea7ab,I09a94042,I69a39039,I35300309, ...
am: 515b2e9434

Change-Id: I49269ac65138be59d68561ea1c15ff2ad0339d8b

Chalard Jean   authored and   android-build-merger   commited 2018-01-24 06:03:41 +00:00
ee75f435b9
Merge "Add xfrm mark in IpSecConfig"
Benedict Wong   authored and   Gerrit Code Review   commited 2018-01-24 05:53:29 +00:00
da7f993d34
Merge changes from topic "bpfStats"
am: e339107631

Change-Id: I488be110cca66990f44f6e45d5489ce23f36432e

Chenbo Feng   authored and   android-build-merger   commited 2018-01-24 05:32:34 +00:00
a0b44c329f
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.

Chalard Jean   authored and   Gerrit Code Review   commited 2018-01-24 04:09:44 +00:00
515b2e9434
Merge changes from topic "bpfStats"
* changes:
  Use /proc/net/dev to get stats summary
  Add bpf support for NetworkStatsFactory
  Add BPF support for NetworkStatsService

Treehugger Robot   authored and   Gerrit Code Review   commited 2018-01-24 04:08:29 +00:00
e339107631
Merge "Add checks to ensure SPIs are not reused"
am: e9f609ee76

Change-Id: I893925014557e5ae13303debc4ee8f50faf9605d

Benedict Wong   authored and   android-build-merger   commited 2018-01-23 19:27:51 +00:00
567ecd6790
Merge changes from topic "multipath-datausage-backport"
am: ae0d925470

Change-Id: Ic29d71ade161434b6dea796a887f60b5587ca1d5

Lorenzo Colitti   authored and   android-build-merger   commited 2018-01-23 19:17:54 +00:00
50f296dec7
Disable IpConnectivityMetricsTest.
am: c4ba57cadd

Change-Id: Iba9dad4001c6aa725285eee6df32f116c846532d

Lorenzo Colitti   authored and   android-build-merger   commited 2018-01-23 19:04:05 +00:00
71472bea68
Merge "Add checks to ensure SPIs are not reused"
Benedict Wong   authored and   Gerrit Code Review   commited 2018-01-23 18:00:06 +00:00
e9f609ee76
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.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2018-01-23 15:22:18 +00:00
ae0d925470
Let network requests see VPNs.
Test: runtest frameworks-net
Test: also tested with VPN app
Test: also cts passing
Change-Id: I3b16caad7787c3c1f2921ca1583815c89efbadc5

Chalard Jean   commited 2018-01-23 21:38:00 +09:00
fd3a4ae0fe
Move constants into a new file.
Also audit all constants, make some private, annotate some
with @VisibleForTesting.

Test: runtest framework && cts
Change-Id: Iaf5ea7abd36fd8d544dcc84654f6cb529196d654

Chalard Jean   commited 2018-01-23 21:38:00 +09:00
3a6b34c989
Make sure listen requests from VPN apps see their own networks
Test: runtest frameworks-net
Test: CTS pass, including with the next patch which is what this
      actually matters for

Change-Id: I09a94042acbefa24ab884f95326e30d6ab280b82

Chalard Jean   commited 2018-01-23 21:38:00 +09:00
b399bf16d1
Add a test for new UID checking code.
Test: manual, this is a new test and it passes
Change-Id: I69a39039647ec05f970700e36c5f1e1e6e110f4a

Chalard Jean   commited 2018-01-23 21:38:00 +09:00
92a116d264
Remove UID_RANGES_ADDED and REMOVED.
Test: runtest frameworks-net
Test: also tested with VPN app
Test: also cts passing
Change-Id: I3530030996daeba05a8f2fffc5c6e21ed62e3f40

Chalard Jean   commited 2018-01-23 21:38:00 +09:00
b2a4991781
Move VPN allowed UIDs into NetworkCapabilities.
Test: runtest frameworks-net
Test: also new specific tests for this new code
Test: also tested with VPN app
Test: also cts passing
Change-Id: If0311bae2bf99dedac959febadecf4f92f3064b8

Chalard Jean   commited 2018-01-23 21:38:00 +09:00
753d9734d2
Pre-import to remove a conflict.
Test: compiles and passes checkstyle
Change-Id: I1ffdd88e6268fee0cf88992420ab21eb42928957

Chalard Jean   commited 2018-01-23 21:38:00 +09:00
cbe99b35a0
Disable IpConnectivityMetricsTest.
This test has been failing for a while, and we are do not have
bandwidth to fix it during the next week.

Test: make -j64 FrameworksNetTests RUN_ERROR_PRONE=true
Test: atest FrameworksNetTests:IpConnectivityMetricsTest
Test: runtest -x frameworks/base/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java
Change-Id: I59d73c1773e160a726996f3ab4ad20312decc127
Merged-In: I59d73c1773e160a726996f3ab4ad20312decc127

Lorenzo Colitti   commited 2018-01-23 18:38:48 +09:00
c4ba57cadd
Use /proc/net/dev to get stats summary
If the qtaguid proc file is no longer exist, the device is running new
eBPF module to do traffic accounting. So the NetworkStatsFactory need to
use the proc/net/dev interface to get the per interface traffic stats
summary. Also, adding a test to verify the helper function work properly

Bug: 30950746
Test: run NetworkStatsFactoryTest
Change-Id: Ia36808bf02f1637dd41a3e7c50917b91b1a77524

Chenbo Feng   commited 2018-01-23 00:35:02 -08:00
b25ada3657
Add bpf support for NetworkStatsFactory
Add the native method used to read the detail information of network
stats from bpf maps. The native method of NetworkStatsFactory should
choose the correct implementation to get the stats detail depending on
the kernel version. Currently the bpf result is printed as a reference
and the actual behavior of NetworkStatsFactory should not change.

Test: NetworkStatsFactory related cts test should not fail.
Bug: 30950746
Change-Id: I4715a23559b5b2306bd556cea0431f0ed172a993

Chenbo Feng   commited 2018-01-23 00:34:53 -08:00
7224ab835a
Add checks to ensure SPIs are not reused
This change adds an additional check in CheckIpsecConfig to prevent
users from using the same SPI twice. This allows for a more granular
error message.

Bug: 70642141
Test: Tests added in IpSecServiceParameterizedTest
Change-Id: I9621fb05c6b162bd8ae8db4ac1e64feaa9d0ac73

Benedict Wong   commited 2018-01-22 21:09:47 -08:00
bb31e20bcd
Merge "Address comments and final cleanup from refcounting integration"
am: 3dcee3120b

Change-Id: Ie0bc2b81e09ee874ef848905bb486967a857c6d1

Benedict Wong   authored and   android-build-merger   commited 2018-01-22 23:57:28 +00:00
9b1dfec3de
Merge "Address comments and final cleanup from refcounting integration"
Benedict Wong   authored and   Gerrit Code Review   commited 2018-01-22 20:32:18 +00:00
3dcee3120b
Merge "Rename create/delete transform methods"
am: 77883ceedc

Change-Id: I76576d1f3193fcbb3680fb29893cf696ea7a41fe

Benedict Wong   authored and   android-build-merger   commited 2018-01-22 19:44:43 +00:00
2af9354354
Merge "Rename create/delete transform methods"
Benedict Wong   authored and   Gerrit Code Review   commited 2018-01-22 17:57:15 +00:00
77883ceedc
Rename create/delete transform methods
CreateTransportModeTransform and DeleteTransportModeTransform are both
agnostic as far as which mode of transform it creates/deletes. As such,
to facilitate the implementation of tunnel mode, this patch renames them
to CreateTransform and DeleteTransform, along with all test names.

Bug: 63588681
Test: frameworks/base unit tests and CTS tests run, passed
Change-Id: I1f015eb7ad0e85fca966658a9402485ca2b44091

Benedict Wong   commited 2018-01-19 10:43:01 -08:00
01e9f19d7b
Merge changes Id8776d14,Ifa291c62,I5ea9d200
am: 5087f93c36

Change-Id: I7a0b01cba8bdee67cffabddacb4ff5f4591cbc34

Lorenzo Colitti   authored and   android-build-merger   commited 2018-01-19 16:30:17 +00:00
69a42fa9c5