Commit Graph

1284 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
6df7f12607 Merge "Fix linter errors in IpServer and its dependencies" am: a9be76c393 am: 4adb05b6b0
am: c922a83872

Change-Id: I4724c27872dc11eb53ed4561743a648ef87bf434
2019-01-07 22:12:50 -08:00
Remi NGUYEN VAN
98feb88705 Merge "Add parceling for DhcpServingParams" am: f6209cf0dd am: 133f281d12
am: 815bd36c07

Change-Id: I953b4380baba93d992601ebde39d7cd63b5bdc3a
2019-01-07 18:30:36 -08:00
Remi NGUYEN VAN
73105e1143 Fix linter errors in IpServer and its dependencies
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I534b391458433ac24dffe78f287e3c83a264acfd
2019-01-08 11:07:58 +09:00
Remi NGUYEN VAN
761198a05d Add parceling for DhcpServingParams
Introduce a stable AIDL parcel class, DhcpServingParamsParcel, and
methods to convert to and from that class to DhcpServingParams.
This will be used to move DhcpServer to the NetworkStack app.

Test: atest FrameworksNetTests
Bug: b/112869080
Change-Id: I276b7affccb938059769c90a53f0f6beb26e6ede
2019-01-07 12:07:18 +09:00
Junyu Lai
864ead76b1 Merge "Ignore ipv6 tx traffic on clat uid." am: bd73798585 am: cb53e78f56
am: 3c6bc9b14d

Change-Id: I1ac85ac863026ea99117c5b0115bcc0c9144fb7b
2019-01-04 08:47:41 -08:00
Junyu Lai
bd73798585 Merge "Ignore ipv6 tx traffic on clat uid." 2019-01-04 09:29:10 +00:00
Remi NGUYEN VAN
90c5bfe077 Merge "Replace InterfaceParams with ifName in DhcpServer" am: 9d5e00321f am: fce422d811
am: 5f5bbffb14

Change-Id: Ib41a931d97610ddeac60012560554c6642186b78
2018-12-17 21:06:01 -08:00
Remi NGUYEN VAN
9d5e00321f Merge "Replace InterfaceParams with ifName in DhcpServer" 2018-12-18 03:38:24 +00:00
Remi NGUYEN VAN
155da48519 Replace InterfaceParams with ifName in DhcpServer
The current code only uses InterfaceParams#name, and InterfaceParams is
defined in services/net which DhcpServer cannot depend on once moved to
a separate app.

Test: atest FrameworksNetTests
Bug: b/112869080
Change-Id: I94c7dce33200c111666a9dddde82ac2e66a6794f
2018-12-17 15:15:16 +09:00
Aaron Huang
e1a4bdb362 Merge "apf: Drop ARP reply if SPA is 0.0.0.0" am: b11a084ebc am: 2c02d789b7
am: 70badb2b3e

Change-Id: I7bb93495865286313e8052d44b54828fff82f244
2018-12-13 19:28:28 -08:00
Aaron Huang
b11a084ebc Merge "apf: Drop ARP reply if SPA is 0.0.0.0" 2018-12-14 03:00:21 +00:00
Mark Chien
cadc75a3cb Merge "Track default upstream when system is ready" am: d9eeba6fd1 am: 8e4f9929e7
am: 25e0a60024

Change-Id: I72c041051f3bd1735a438f8ce7ded83cf26136f9
2018-12-13 15:35:04 -08:00
Aaron Huang
751ad46524 Merge "Add an APF unit test to drop all packets in the pcap file" am: 0d9b942292 am: 986597923a
am: 9410251786

Change-Id: Iedafc2ea20722060300ec892c32de64fb9dcb6db
2018-12-13 11:14:13 -08:00
Mark Chien
d9eeba6fd1 Merge "Track default upstream when system is ready" 2018-12-13 13:28:08 +00:00
markchien
a6c7287f41 Track default upstream when system is ready
Start tracking default upstream from boot.This is useful for
entitlement refine in following change. EntitlementManager can
decide if it needs to process entitlement provisioning before
tethering started.

Test: -atest FrameworksNetTests
      -build, flash, booted
      -manually turnoff/on tethering with different upstream
bug: 111490073

Change-Id: I8fdbd64c52f26b5363693bb5bd8050930e8ea961
2018-12-13 19:01:51 +08:00
Aaron Huang
0d9b942292 Merge "Add an APF unit test to drop all packets in the pcap file" 2018-12-13 03:05:56 +00:00
Etan Cohen
3c2a2034e4 Merge "[CM] Fix comments, add tests to TransportInfo API" am: 4060bc1480 am: e603fe8bc0
am: d548b6e050

Change-Id: I0a81b7b48bb02da202dd7feaa1440801b794ce67
2018-12-11 22:22:36 -08:00
Etan Cohen
bd648ce246 [CM] Fix comments, add tests to TransportInfo API
Bug: 117605977
Test: atest NetworkCapabilitiesTest
Change-Id: I734ec56e44cd09d11ae81a856a53a26e1191b9a0
2018-12-11 15:00:10 -08:00
Aaron Huang
04ed6a3592 apf: Drop ARP reply if SPA is 0.0.0.0
Some network re-writing packet from broadcast MACs to unicast,
result in this kind of packets cannot be dropped by APF filter.
Thus, drop ARP reply if source IP is 0.0.0.0.

Note: Linux kernel always ignores such replies in the function arp_process().

Bug: 118044271
Test: runtest frameworks-net -c android.net.apf.ApfTest
Change-Id: Id293bf231913d9b483ce7d8dd909e05fa927ccd7
2018-12-10 14:18:14 +00:00
Aaron Huang
785e5f1f96 Add an APF unit test to drop all packets in the pcap file
Read a pcap file and runs it through APF filter, then checks whether all
packets in the file are dropped.

Test: runtest frameworks-net -c android.net.apf.ApfTest
Change-Id: I7fc59864608762cd2bc84131817183846b0bf5b5
2018-12-10 21:05:14 +08:00
Junyu Lai
71c9bea9a8 Merge "Refactoring of deleting stats in NetworkStats based on uids." am: 0882543a12 am: 9867b60f39
am: c92749ad72

Change-Id: I29c57276424464afd54e184c369d30a5e9707f14
2018-12-10 03:10:15 -08:00
Lorenzo Colitti
80b8ce887c Merge "Increase the IpClientTest timeouts to reduce flake rate." am: 4e780bd992 am: db3380c87f
am: 95872aa3d1

Change-Id: I645c9fa2b0c9ab234c19a47c9dd09bf132bbe06b
2018-12-10 02:45:27 -08:00
Etan Cohen
4bbe8cc1af Merge "[CS] Add a generic transport-specific information API" am: 7f50b11c89 am: 14062aa659
am: 79cee813c9

Change-Id: I47e0a7d62434b05d4692f9835af93c3a5dd61027
2018-12-10 02:39:46 -08:00
junyulai
f6ebf4ae08 Ignore ipv6 tx traffic on clat uid.
Currently, 464xlat counts its ipv6 tx traffic into root uid.
When user is making ipv4 upload over ipv6-only network, ipv4
tx traffic may sometimes be counted faster then ipv6 tx
traffic.

Thus, NetworkStatsService may detect non-monotonic values due
to 464xlat adjustment.

So the solution is that: for clatd, make ipv6 tx traffic counts
into clat uid, and then ignore it in the framework side.

Bug: 118602783
Test: 1. manually verify clatd traffic on clat uid.
      2. runtest frameworks-net

Change-Id: Ifb478b79e3e281918c70e16d1f90682c78f33db1
2018-12-10 15:19:03 +08:00
Junyu Lai
0882543a12 Merge "Refactoring of deleting stats in NetworkStats based on uids." 2018-12-10 05:15:28 +00:00
Treehugger Robot
4e780bd992 Merge "Increase the IpClientTest timeouts to reduce flake rate." 2018-12-09 04:23:19 +00:00
Etan Cohen
7f50b11c89 Merge "[CS] Add a generic transport-specific information API" 2018-12-09 03:53:44 +00:00
Etan Cohen
ca9fb56ee4 [CS] Add a generic transport-specific information API
Add a generic transport-specific information container interface and
access methods. These can be used by a network factory to pass transport
(bearer)-specific network parameters to the app.

Bug: 117605977
Test: atest frameworks/base/tests/net/java/android/net (+new unit tests)
Change-Id: Ib7c83b677e1c02a2212265719813e648b0c9cc1b
2018-12-07 17:37:48 +00:00
Lorenzo Colitti
87c7dffc35 Increase the IpClientTest timeouts to reduce flake rate.
Fix: 120131319
Test: atest FrameworksNetTests
Change-Id: Ibb70fa74c71608fd76e85636607e860dd58c404a
2018-12-07 19:02:20 +09:00
Chenbo Feng
086ad0ed2f Merge "Call netd to update the tcp buffer size" am: 51b1e458de am: 7abbfaddab
am: 9f3d267b69

Change-Id: I9df7c3d6b1d613e8c9a7b7a2bd0da05c2e17a291
2018-12-06 11:53:39 -08:00
Treehugger Robot
51b1e458de Merge "Call netd to update the tcp buffer size" 2018-12-06 19:01:24 +00:00
junyulai
8b8684abc9 Refactoring of deleting stats in NetworkStats based on uids.
In follow-up commits, current API would create new NetworkStats
every time when 464xlatAdjustment wants to filtered out some
uids.

This commit refactors it to delete stats in-place to get better
performance.

Bug: 118602783
Test: atest FrameworksNetTests
Change-Id: I858f95d1fa7733111786243b4e261ce8a70a068d
2018-12-06 19:01:17 +09:00
Luke Huang
fb1270ae9f Merge "Use ParcelFileDescriptor instead of FileDescriptor in INetd.aidl" am: d6c2dc5908 am: db15177cf7
am: 59cffee13d

Change-Id: I1dd010a0b4ec54c87b509c1e05185164fde9e4cb
2018-12-04 22:44:36 -08:00
Luke Huang
e8e522bb31 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
d94e7d893b Merge "Data stall detection using DNS event" am: 33fe80f927 am: 69b60f5a31
am: f720f0dbf8

Change-Id: I5c443b959a45b3a70902d5c9738a1687e16cc766
2018-11-27 20:33:20 -08:00
Chiachang Wang
33fe80f927 Merge "Data stall detection using DNS event" 2018-11-28 03:53:30 +00:00
Chenbo Feng
7f14dbc33f 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
7a70a7e0ed 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
f467593202 Merge "PermissionMonitor: Move intent receiver to ConnectivityService." am: ef557cf6b3 am: 702b4474a7
am: 247ddc017f

Change-Id: I7b23a8a6e2a636998adc7b279a848b0c0e86baf4
2018-11-26 19:02:19 -08:00
Junyu Lai
ef557cf6b3 Merge "PermissionMonitor: Move intent receiver to ConnectivityService." 2018-11-27 01:48:59 +00:00
Benedict Wong
1215943a55 Merge changes from topic "xfrmi-support" am: f928c1e4b9 am: bc33474522
am: 03c6d371aa

Change-Id: I9c543d38c88181b12cdbc7bdb93d7e38f1dfd425
2018-11-25 19:38:35 -08:00
Benedict Wong
f928c1e4b9 Merge changes from topic "xfrmi-support"
* changes:
  Cleanup and update comments SA mark disabling comments
  Add XFRM-I support to IpSecService
  Disable attempted updating of SA marks
2018-11-26 03:04:16 +00:00
markchien
5ea85caff5 Merge "Add Entitlement Manger to encapsulate provisioning mechanics" am: 1c66fd2d67 am: 8a01337f5c
am: e65bc4d11e

Change-Id: If72fa0a253ed6542e790b74e1504212275bc327e
2018-11-25 19:02:18 -08:00
Treehugger Robot
1c66fd2d67 Merge "Add Entitlement Manger to encapsulate provisioning mechanics" 2018-11-26 02:17:29 +00:00
Benedict Wong
781dae6306 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
junyulai
2454b699f3 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
markchien
b6eb2c218b Add Entitlement Manger to encapsulate provisioning mechanics
Test: - build, flash, booted
      - runtest frameworks-net

bug: 111490073

Change-Id: I4f67f8679ab91b5c463fc349f5f21aee08bd943e
2018-11-20 17:51:52 +08:00
Etan Cohen
a8923c5aea 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
Etan Cohen
a4824cf401 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
Change-Id: I80b683e69da6beff3b37fc345fc15aa9610d09b7
2018-11-16 14:00:22 -08:00
Junyu Lai
15a1266b17 Merge "Use spy in PermissionMonitorTest." am: df01b11de1 am: 999733c5fa
am: 9c10dcc0f1

Change-Id: I1478b9c2bb12b6bfd161be99c5faa7aec76d9a7f
2018-11-09 14:16:41 -08:00