Commit Graph

5621 Commits

Author SHA1 Message Date
Luke Huang
1038ffef1b Merge "Use ParcelFileDescriptor instead of FileDescriptor in INetd.aidl" 2018-12-05 05:55:49 +00:00
android-build-team Robot
1151e49dce Merge cherrypicks of [5704859, 5705300, 5704034, 5704195, 5705082, 5704058, 5704059, 5704932, 5705340, 5705341, 5705342, 5705343, 5705344, 5705361, 5705362, 5705363, 5705364, 5704870, 5704196, 5705083, 5701785, 5701786, 5701787, 5704035, 5705261, 5705281, 5704036, 5704037, 5704038, 5704871, 5704933, 5704872, 5705347, 5705262, 5704934] into pi-qpr2-release
Change-Id: Ifb7d048c4deb34b18e69173fd09e91c45980e2d9
2018-12-05 05:16:39 +00:00
junyulai
5ff6752475 Fix negative uid stats caused by 464xlat adjust when eBPF is on.
When using xt_qtaguid to count per uid stats,
NetworkStatsService needs to adjust the 464xlat traffic since
iptables module would double count for ipv4 and ipv6 packet.
But for eBPF, the per uid stats is collected in a different
hook, so the adjustment on root uid would only be needed in tx
direction.

Bug: 112226716
Test: 1. Make ipv4 traffic in ipv6-only network and check data
         usage.
      2. Make ipv4 traffic in a client which connect to
         ipv6-only hotspot.
      3. runtest frameworks-net
      4. cts-tradefed run cts -m CtsNetTestCases -t \
                 android.net.cts.TrafficStatsTest
      5. cts-tradefed run cts -m CtsUsageStatsTestCases

Change-Id: Ic9a84f5446eddc943c255d5f3b89dad171f53cac
Merged-In: Ic9a84f5446eddc943c255d5f3b89dad171f53cac
(cherry picked from commit c33ac0d43b594f6154accf03ae7e3fd34dedc79d)
(cherry picked from commit e43ff3e85f)
2018-12-05 05:13:56 +00:00
Lucas Lin
7aa3fe1ebd Merge "Simpify logic in updateTcpBufferSizes"
am: 08d5bca515

Change-Id: Ia95fd298cdea4b47cc9842b63f11282de58d18f7
2018-11-29 00:55:52 -08:00
Bill Yi
94335ab16f Merge pi-qpr1-release PQ1A.181105.017.A1 to pi-platform-release
Change-Id: Id08fdcae21e3ceb54e893a9ed11da6e67c889895
2018-11-28 18:45:59 -08:00
lucaslin
821c97863f Simpify logic in updateTcpBufferSizes
updateTcpBufferSizes() only need tcp buffer size as its
parameter. Also unify the logic to check default network
outside the function.

Bug: 120119769
Test: 1. Build pass.
      2. runtest frameworks-net

Change-Id: Iee9fec3efe7d5be5b590dd1c1f67ec5de636e613
2018-11-29 01:35:54 +00:00
Lucas Lin
8862ea3337 Merge "Update LinkProperties to NetworkAgentInfo only when it's changed"
am: 0683c607b6

Change-Id: I681eaea9dfccaef5c0f003c2cef7721539f7328c
2018-11-28 02:22:50 -08:00
Lucas Lin
0683c607b6 Merge "Update LinkProperties to NetworkAgentInfo only when it's changed" 2018-11-28 09:57:48 +00:00
lucaslin
74fa397f15 Update LinkProperties to NetworkAgentInfo only when it's changed
In previous design, it will always assign newLp to nai in
handleUpdateLinkProperties(). And Private dns configuration
will be missing when the same LinkProperties are updated
because the updated LinkProperties is not assigned back to
NetworkAgentInfo.

Bug: 118518971
Test: 1.Build pass.
      2.runtest frameworks-net

Change-Id: I405c8f29497fec438082a2cf30eb5c7b9497e1c4
2018-11-28 06:16:38 +00:00
Luke Huang
a904fab046 Use ParcelFileDescriptor instead of FileDescriptor in INetd.aidl
Stable aidl won't support FileDescriptor but ParcelFileDescriptor.
In order to migrate to stable aidl, replace all FileDescriptor in
INdetd.aidl.

Test: runtest frameworks-net passes
Change-Id: Icdf37aed0e0cce0352070a437066e77c0f2fd85a
2018-11-28 13:41:58 +08:00
Chiachang Wang
aad60e773d Merge "Data stall detection using DNS event"
am: 45c772fabc

Change-Id: I4b5248e97028bf8e9e837ff5ccf8e0d3138f7b05
2018-11-27 20:09:03 -08:00
Chiachang Wang
45c772fabc Merge "Data stall detection using DNS event" 2018-11-28 03:53:30 +00:00
Chenbo Feng
1541629a3f Call netd to update the tcp buffer size
The system server is controlling the tcp buffer now by writing to
/sys/kernel/ipv4/tcp_{rmem,wmem}_{min,def,max}. Those files are
basically the same as /proc/sys/net/ipv4/tcp_{rmem,wmem} except those
latter ones contain all three values in one file. Netd can directly write
to those files so we no longer need to depend on these android specific
files.

Test: netd_integration_test
Bug: 118572798
Change-Id: I588b48be29ecf61fd5bbf94f97f63738be4eae25
2018-11-27 15:37:52 -08:00
Chiachang Wang
686e7c02e0 Data stall detection using DNS event
If dns resolver on a network get consecutively timeout then it
is a strong signal that the network is no longer usable.
Reevaluate the network once it's data stall suspected

Test: 1. runtest frameworks-net
      2. SettingsBackupTest passes
      2. Run on wifi w/o internet capability
Bug: 112653893, 113916551

Change-Id: I74287b174d933f97a91fa1529b1809856ac3b38d
2018-11-27 18:00:05 +08:00
Junyu Lai
5a7867d2ab Merge "PermissionMonitor: Move intent receiver to ConnectivityService."
am: 687cb5a0ed

Change-Id: I1038abba55ba5492dd8958c365500714b0e8ffd8
2018-11-26 18:07:33 -08:00
Junyu Lai
687cb5a0ed Merge "PermissionMonitor: Move intent receiver to ConnectivityService." 2018-11-27 01:48:59 +00:00
android-build-team Robot
533870117c Snap for 5140444 from 294484563c94eedd70f8dd53d134d701a1d6e9cb to pi-qpr2-release
Change-Id: Iae8b94ce89b79e0e3fd9f0e2daf7d186660f2df9
2018-11-26 18:42:25 +00:00
Benedict Wong
4b7bb9f374 Merge changes from topic "xfrmi-support"
am: f928c1e4b9

Change-Id: I9b76a58ab9ebdb9abb01216e8b3916f1f52f9267
2018-11-25 19:15:37 -08:00
jiayanhong
a03720b3e9 Fixed toString() printing error
There maybe some copy paste error about mNetworkCapabilities
and mUnwantedNetworkCapabilities in NetworkCapability#toString()

Test: manual + CodeDEX scan
Change-Id: I9997163e8b557590c27d15f0b2184ce6e1a53647
2018-11-23 14:23:04 +08:00
Benedict Wong
12b70569f9 Add XFRM-I support to IpSecService
This change adds support for XFRM-I to all IpSecService netd calls.
Fallback logic is in netd, and thus both VTI and XFRM-I parameters are
always passed down to IpSecService.

Bug: 78589502
Test: All java, CTS tests passing
Change-Id: Ie4186f0ad7e50763b21831f6fa411b5ee436de78
2018-11-21 08:34:54 -08:00
android-build-team Robot
0ab2f7b947 Snap for 5143169 from 807672ac4fcd5b877fd7a404f22595cd9ae7ad0a to pi-qpr2-release
Change-Id: I679936796f8e82f1d510e317b4036299128ad06c
2018-11-21 04:05:40 +00:00
junyulai
df46b35279 PermissionMonitor: Move intent receiver to ConnectivityService.
Currently, PermissionMonitor listen to user add/remove and
package add/remove intent respectively, and so does VPN.
Thus, races might occurr between them.

This commit refactor PermissionMonitor part by using
ConnectivityService to listen to intents and dispatch events
to PermissionMonitor.

Bug: 118811303
Test: 1. atest FrameworksNetTests
      2. manually add/remove package

Change-Id: I6e45b5870d5b1300cad252d25bdb4da78f9bf70e
2018-11-21 12:17:10 +09:00
Jack Yu
44676f50d4 Merge "Move hidden APIs into system APIs"
am: c606db86c8

Change-Id: Ic35d305ce0a7e6d0472bfe76ee00034abdd918c5
2018-11-20 18:56:13 -08:00
Jack Yu
c606db86c8 Merge "Move hidden APIs into system APIs" 2018-11-21 02:40:30 +00:00
Etan Cohen
e6db899061 Merge "Add IPv6 link-local address generation from EUI-48"
am: fb0dcb1ed7

Change-Id: I463cc804b21c99512e506b60a44cd62732d3c2b2
2018-11-19 16:38:06 -08:00
Etan Cohen
fb0dcb1ed7 Merge "Add IPv6 link-local address generation from EUI-48" 2018-11-20 00:19:54 +00:00
Jack Yu
2268041efb Move hidden APIs into system APIs
To allow vendor code to construct LinkAddress, which is
one of the parameter in the system API DataCallResponse.

Test: Build
Bug: 73659459
Merged-In: I3e203781d3a03285fa0e047cc8837ccb4a09016a
Change-Id: I3e203781d3a03285fa0e047cc8837ccb4a09016a
2018-11-19 14:40:13 -08:00
Remi NGUYEN VAN
e668ae16bc Merge "(Really) fix LingerMonitor rate limiting"
am: cf33708bcd

Change-Id: I3b03f5985137a57e7c3ed3b2e0030078a4ea676d
2018-11-18 23:26:25 -08:00
Treehugger Robot
cf33708bcd Merge "(Really) fix LingerMonitor rate limiting" 2018-11-19 07:14:11 +00:00
Etan Cohen
ec1c466cb0 Add IPv6 link-local address generation from EUI-48
Add a utility method to convert an EUI-48 to an IPv6 link-local
address based on RFC 4291 (EUI-64 generation) followed by RFC 4862.

Bug: 117605977
Test: atest MacAddressTest
Merged-In: I80b683e69da6beff3b37fc345fc15aa9610d09b7
Change-Id: I80b683e69da6beff3b37fc345fc15aa9610d09b7
2018-11-16 21:50:24 -08:00
Remi NGUYEN VAN
2fd1499f6a (Really) fix LingerMonitor rate limiting
The previous patch was applied to the wrong member and did not actually
fix the issue.

Bug: b/117516272
Test: remote run passed
Change-Id: I3f9c27ebd6c339e98a71cb179b0be65950f9b864
2018-11-16 14:53:14 +09:00
Remi NGUYEN VAN
65cf30800c Merge "Fix LingerMonitor notification rate limiting"
am: 822d2b5991

Change-Id: I68800c06e8d4413b2e46176a12dc60b436277653
2018-11-13 01:46:21 -08:00
Treehugger Robot
822d2b5991 Merge "Fix LingerMonitor notification rate limiting" 2018-11-13 09:36:39 +00:00
Josh Gao
bc2208a2a2 Avoid calling ParcelFileDescriptor.fromSocket on new Sockets.
Previously, we were calling ParcelFileDescriptor.fromSocket on a newly
initialized Socket, which doesn't actually create a file descriptor
until the Socket is bound or connected.

Bind the Socket to a random port to force the file descriptor to be
allocated.

Test: treehugger
Change-Id: Id92a3e1316881d1c5382485aa2d6a41fc37e9651
2018-11-09 14:10:40 -08:00
Junyu Lai
57b23ac131 Merge "Use spy in PermissionMonitorTest."
am: e666ae6ee5

Change-Id: I6074b6fb2f90821ddad93db18fbb633225b4292f
2018-11-09 01:01:25 -08:00
Junyu Lai
e666ae6ee5 Merge "Use spy in PermissionMonitorTest." 2018-11-09 08:47:03 +00:00
junyulai
4ae90ee86e Use spy in PermissionMonitorTest.
Bug: 118811303
Test: runtest frameworks-net
Change-Id: Id61a9efecf1d1ed5a9045b78ecfec9239e13967b
2018-11-09 12:37:16 +08:00
soma, kawata
0ecbb97b4a Merge "Add skip464xlat test in Nat464XlatTest"
am: aef8fe0d47

Change-Id: If437d8eadbc81655756b9b7cac1a5cda019a45da
2018-11-08 05:00:10 -08:00
junyulai
e43ff3e85f Fix negative uid stats caused by 464xlat adjust when eBPF is on.
When using xt_qtaguid to count per uid stats,
NetworkStatsService needs to adjust the 464xlat traffic since
iptables module would double count for ipv4 and ipv6 packet.
But for eBPF, the per uid stats is collected in a different
hook, so the adjustment on root uid would only be needed in tx
direction.

Bug: 112226716
Test: 1. Make ipv4 traffic in ipv6-only network and check data
         usage.
      2. Make ipv4 traffic in a client which connect to
         ipv6-only hotspot.
      3. runtest frameworks-net
      4. cts-tradefed run cts -m CtsNetTestCases -t \
                 android.net.cts.TrafficStatsTest
      5. cts-tradefed run cts -m CtsUsageStatsTestCases

Change-Id: Ic9a84f5446eddc943c255d5f3b89dad171f53cac
Merged-In: Ic9a84f5446eddc943c255d5f3b89dad171f53cac
(cherry picked from commit c33ac0d43b594f6154accf03ae7e3fd34dedc79d)
2018-11-07 10:16:26 +08:00
soma, kawata
4d041d5caa Add skip464xlat test in Nat464XlatTest
Bug: 69949375
Test: Nat464XlatTest, ConnectivityServiceTest

Change-Id: Ibc66d9c2dc8e3d1f118e5f6940e7b3fd4646efd1
2018-11-06 06:02:50 +00:00
Remi NGUYEN VAN
1dd54da1f6 Fix LingerMonitor notification rate limiting
If time since boot is lower than the rate limit, notifications would not
be shown.
This is causing tests to fail on continuous testing.

Test: atest FrameworksNetTests
Bug: b/117516272
Change-Id: I03da28f2ca61119fa0ef9534bb4ce3f6406c1ff2
2018-11-02 17:26:37 +09:00
Paul Hu
5d443532b6 Merge "Support backward compatibility for restricted network permission"
am: 3e8de1cade

Change-Id: I15ef9c6efd40e8fe9bb9ff6ae98cae556dc0f8fd
2018-11-01 00:33:39 -07:00
Paul Hu
3e8de1cade Merge "Support backward compatibility for restricted network permission" 2018-11-01 07:20:05 +00:00
paulhu
8e38c05bb3 Support backward compatibility for restricted network permission
Some native daemons legacy design work with SYSTEM_UID. If none of
SYSTEM_UID apps declare the restricted network permission, it will
result in permission denial in daemons. Allow SYSTEM_UID in the
devices shipped before Q to support backward compatibility.

Bug:114245686
Test: 1. runtest frameworks-net
      2. atest FrameworksNetTests
      3. Native daemons with SYSTEM_UID can work normally

Change-Id: I6f3f0d83bcae74ef5389535b528af3baf649fa48
2018-11-01 10:38:11 +08:00
Junyu Lai
8711dff1be Merge "Fix negative uid stats caused by 464xlat adjust when eBPF is on."
am: 0d63da86e2

Change-Id: Ia5120619ce7d5cedd6e558ed4d1dc9a706638796
2018-10-30 19:35:32 -07:00
junyulai
1d103a9809 Fix negative uid stats caused by 464xlat adjust when eBPF is on.
When using xt_qtaguid to count per uid stats,
NetworkStatsService needs to adjust the 464xlat traffic since
iptables module would double count for ipv4 and ipv6 packet.
But for eBPF, the per uid stats is collected in a different
hook, so the adjustment on root uid would only be needed in tx
direction.

Bug: 112226716
Test: 1. Make ipv4 traffic in ipv6-only network and check data
         usage.
      2. Make ipv4 traffic in a client which connect to
         ipv6-only hotspot.
      3. runtest frameworks-net
      4. cts-tradefed run cts -m CtsNetTestCases -t \
                 android.net.cts.TrafficStatsTest
      5. cts-tradefed run cts -m CtsUsageStatsTestCases

Change-Id: Ic9a84f5446eddc943c255d5f3b89dad171f53cac
2018-10-30 21:23:38 +08:00
Luke Huang
55c7b00f65 Merge "Refactor UidRange by using stable aidl structure"
am: 1742c23b88

Change-Id: I9ac52f3869fe051d0ef7f45768f1defad155b53b
2018-10-28 17:44:20 -07:00
Treehugger Robot
1742c23b88 Merge "Refactor UidRange by using stable aidl structure" 2018-10-29 00:17:34 +00:00
Chalard Jean
a7a96dd623 Merge "ConnectivityService: make log configurable"
am: 3ec9281fa8

Change-Id: I5991e26198aa5d5ad809e2585984cb643889a9d1
2018-10-25 23:22:48 -07:00
Chalard Jean
3ec9281fa8 Merge "ConnectivityService: make log configurable" 2018-10-26 06:06:19 +00:00