Commit graph

105,600 commits

Message SHA1
thread: rename init.34rc to ot-daemon.34rc for clarity
(this renames the file in the apex, but should otherwise not matter)

Test: TreeHugger, manually on cf (thread daemon still starts)
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6087f95b0f3a4ba10b922ca78d2210377d5075ea

Maciej Żenczykowski   commited 2024-08-30 18:43:42 +00:00
bd1fd22ffa
Merge "Add mainline module controller for tethering" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-08-30 16:10:26 +00:00
5858cfeb1f
Add mainline module controller for tethering
Bug: 361813608
Bug: 358007993
Change-Id: I4287f0670fd7b3b1ccbeaa7056b6bbedc6768f7e

Tongbo Liu   authored and   Lorenzo Colitti   commited 2024-08-30 15:04:34 +00:00
603b8e0205
Merge "Support checking DnsResolver version in isFeatureSupported." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-08-30 04:17:09 +00:00
a0dc47579c
Merge "NetBpfLoad - update init rc docs for U QPR3 and V" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-08-30 03:30:02 +00:00
64c64af3d2
Merge "Add flag for collecting tethering active sessions metrics" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-08-30 03:10:53 +00:00
4de2b911a9
Support checking DnsResolver version in isFeatureSupported.
Test: new unit tests
Change-Id: Ia251c068806a3d8c970d984322d4cb7e2364c1ef

Lorenzo Colitti   commited 2024-08-30 11:50:12 +09:00
ca67820a94
NetBpfLoad - update init rc docs for U QPR3 and V
Generated via:
  grab() { ( cd /android/packages/modules/Connectivity && git cat-file -p remotes/goog/$1:netbpfload/netbpfload.rc | egrep -v '^ *#'; ); }
  grab 24Q1-release > bpfloader-sdk34-14-U-QPR2.rc
  grab 24Q2-release > bpfloader-sdk34-14-U-QPR3.rc
  grab 24Q3-release > bpfloader-sdk35-15-V.rc

Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5bb64e001ab30560a2824ca48cfc0370771abb27

Maciej Żenczykowski   commited 2024-08-29 18:15:42 -07:00
79e404b2a3
Merge "dscpPolicy: prevent cache overflow" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-08-30 01:13:59 +00:00
6b387a2219
dscpPolicy: prevent cache overflow
It has been a long standing bug that eventually the dscp
policy socket cache fills up and stops working for new
sockets.

The intent was this would be periodically cleared on some
sort of LRU basis from userspace.

But why bother?

We convert from hash[cookie:u64] to array[cookie % X].
If the cache misses, we simply recalculate and replace it.

This also allows us to reduce the size of the map:
we go from 1024 entries to 32 entries per cpu (likely ~8) so 256.

We're unlikely to have many active flows on any given cpu
at any given time - and the chance of collision is reasonable,
so thrashing should be minimal.

Longer term it would probably be even better to use
socket local storage for this purpose...

(Note: we don't have generation ids on the policy,
so we still don't apply new policy / policy changes
to old sockets... oh, well...)

Test: TreeHugger, atest CtsNetTestCases:android.net.cts.DscpPolicyTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia570aec44e399d326c165b271ae4dad01f8aa100

Maciej Żenczykowski   commited 2024-08-30 01:13:53 +00:00
52ff2b64cd
Merge "bpf: git mv netd bpf/netd (plus update visibility for new path)" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-08-29 23:54:21 +00:00
f7cf3e38ae
Merge "NetBpfLoad: reliably log message on map creation failure" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-08-29 22:37:34 +00:00
6201c11370
bpf: git mv netd bpf/netd (plus update visibility for new path)
Another step towards moving all bpf related stuff into a common directory.

In practice netd_updatable is only actually used for bpf...

The upcoming netbpfload UML test should be checking netd_updatable's
initialization succeeds (useful since that opens a bunch of maps
fetches some programs, and attaches them to a bunch of cgroup hooks).

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I65a0fbbf18bf0aa87938df691c0a9ebcca9a084c

Maciej Żenczykowski   commited 2024-08-29 22:25:51 +00:00
04ed60fa25
NetBpfLoad: reliably log message on map creation failure
(ALOGD can get entirely stripped out of the logs)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I513d10acb9f1cc330b9cd5a4245f3af7e790a4d6

Maciej Żenczykowski   commited 2024-08-29 21:18:22 +00:00
8597e3ac16
bpf_headers: add bpf_printf() helper macro
(pulled from my notes / in-progress work on non-Android clat implementation)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iae662f542be371c4110205c8c3bef0a416b47566

Maciej Żenczykowski   commited 2024-08-29 21:18:17 +00:00
2a8bf65973
NetBpfLoad: don't log the program failure buffer if it is empty
BPF_PROG_LOAD can fail with various permission related
errors, and then it doesn't provide any extra debug details.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9f6f0bf30158828fe31045a11a1f4c015feeb61e

Maciej Żenczykowski   commited 2024-08-29 21:18:00 +00:00
9f8b17ee5b
NetBpfLoad: better log message on program load failure
We're reduced logging enough that it is no longer clear
which program failed to load.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8919a055f82d0c0e6e6818799463c606e853f70b

Maciej Żenczykowski   commited 2024-08-29 21:17:12 +00:00
bfc0b6187c
Merge "NetBpfLoad: do not log bpfGetFdMapId() failures on 4.9" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-08-29 21:15:29 +00:00
461b408129
NetBpfLoad: do not log bpfGetFdMapId() failures on 4.9
This is entirely expected due to lack of implementation in <4.14.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ifebe6843dc77b1b9a506c61239dcebe7262d0869

Maciej Żenczykowski   commited 2024-08-29 12:19:56 -07:00
508c8f7857
NetBpfLoad: hacky way to make LPM_TRIE bpf maps work.
Longer term we should fix the bpf_map_def.h to
actually set map_flags correctly.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4e7954ccd0afad4ca8d9cec179ad6efa20592609

Maciej Żenczykowski   commited 2024-08-29 18:10:28 +00:00
dcb2e7496c
Merge "Add mIngressToVpnAddressFiltering to dump" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-08-29 11:57:24 +00:00
00969a2835
Merge "Remove unused methods and restrict visibility in LocationPermissionChecker" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-08-29 11:19:24 +00:00
6f005ff41b
Add mIngressToVpnAddressFiltering to dump
Example output:

Multicast routing supported: true
Background firewall chain enabled: true
IngressToVpnAddressFiltering: false

Bug: 362434644
Test: adb shell dumpsys connectivity
Change-Id: I36e0726d7b7ffe873ed6498a45f57c459cc884cc

Motomu Utsumi   commited 2024-08-29 19:24:47 +09:00
727dd5dea4
Add flag for collecting tethering active sessions metrics
This is needed for follow-up CLs to wrap necessary code
change under this flag.

Test: TH
Bug: 354619988
Change-Id: I7a36ff228b1ff34860c7fa4e90537ad87f543ddc

Junyu Lai   commited 2024-08-29 17:18:25 +08:00
9bd74757ea
NetworkTracePoller: fix a warning by explicitly capturing 'this'
Without this:
packages/modules/Connectivity/service-t/native/libs/libnetworkstats/NetworkTracePoller.cpp:42:35: warning: implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture]
   42 |   runner->PostDelayedTask([=]() { PollAndSchedule(runner, poll_ms); }, poll_ms);
      |                                   ^
packages/modules/Connectivity/service-t/native/libs/libnetworkstats/NetworkTracePoller.cpp:42:28: note: add an explicit capture of 'this' to capture '*this' by reference
   42 |   runner->PostDelayedTask([=]() { PollAndSchedule(runner, poll_ms); }, poll_ms);
      |                            ^
      |                             , this

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I703f2e33948c226c43e170abc793b8a58438eccf

Maciej Żenczykowski   commited 2024-08-28 10:41:07 -07:00
b055f15845
Merge "[Thread] split the configuration and the infra link state" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-08-28 13:34:02 +00:00
9309dc87c3
[Thread] split the configuration and the infra link state
This CL works with the corresponding ot-br-posix CL to separate the
config and the infra link state. In this way,
ThreadNetworkControllerService will call different APIs to send the
config/state to ot-daemon.

Bug: 362172947

Change-Id: Iae98325358f81ea2ff0c672577cc21a128ae049a

Handa Wang   commited 2024-08-28 09:28:46 +00:00
989cc83c27
[Thread] make Thread flags fixed_read_only
The newly added Thread flags (i.e. configuration_enabled and
channel_max_power_enabled) are not visible on gantry. This is due to the
flags are not fixed.

Bug: 346686506
Change-Id: I4c50507c90057132aa336a401a53e9c560acd8bc

Kangping Dong   commited 2024-08-28 13:55:15 +08:00
8fb3f07dfe
Merge changes I24816b66,I84ddec9a,Iae64b900,I3bd83e19,Idc910478 into main
* changes:
  NetBpfLoad: introduce APEXROOT/BPFROOT defines
  NetBpfLoad: sort BPF_PROG_LOAD bpf_attr req field order
  NetBpfLoad: remove spurious header includes
  dscpPolicy: switch to bool
  bpf: git mv tests/mts bpf/tests/mts

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-08-27 17:57:50 +00:00
9734ebfcc7
Merge "Use doReturn instead of when().thenReturn" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-08-27 06:28:01 +00:00
e73285c622
Remove unused methods and restrict visibility in LocationPermissionChecker
Bug: 337473824
Test: TH
Change-Id: Ie14a5bdb39742d4c086f63fca3e12521e1ad84a7

Motomu Utsumi   commited 2024-08-27 15:25:34 +09:00
3625bf6fae
Merge "Minor Fix in NetworkStatsService" into main
Yun-Chen Cheng   authored and   Gerrit Code Review   commited 2024-08-27 05:37:48 +00:00
340a2e3bf4
NetBpfLoad: introduce APEXROOT/BPFROOT defines
This allows changing the location of bpf programs easily
when building for the host to run on UML as a test.

Bug: 205608149
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I24816b6660581e74f277df39495a43027b77d2cf

Maciej Żenczykowski   commited 2024-08-26 17:29:52 -07:00
78fa86107b
NetBpfLoad: sort BPF_PROG_LOAD bpf_attr req field order
Some compilers warn/error and fail to build if it is not in proper order.
(specifically: triggers during build for host)

Bug: 205608149
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I84ddec9a2443939616fd78f522e8620680e1289e

Maciej Żenczykowski   commited 2024-08-26 17:29:47 -07:00
52be6a822d
NetBpfLoad: remove spurious header includes
(particularly problematic on host builds where host headers are ancient...)

Bug: 205608149
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iae64b900464e7584ad657f18d8101993fd8c8e33

Maciej Żenczykowski   commited 2024-08-26 17:29:41 -07:00
020eaf4dd5
dscpPolicy: switch to bool
Bug: 361492282
Test: TreeHugger, atest CtsNetTestCases:android.net.cts.DscpPolicyTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3bd83e19a814d811028f8bd60d3e0a794050338e

Maciej Żenczykowski   commited 2024-08-26 16:44:17 -07:00
d6c0db3b41
bpf: git mv tests/mts bpf/tests/mts
Another step towards moving all bpf related stuff into a common directory,
which will ease development.

I want to refactor this test so that it can also be run as a self-test
in UML (for testing bpfloading functionality across a large variety of
Linux kernel (both major and minor LTS) and Android (API/SDK level)
platform versions.

Bug: 205608149
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Idc9104783b2fa60626e9c1fd463c4d94fd4a908c

Maciej Żenczykowski   commited 2024-08-26 16:19:48 -07:00
548e35eb42
Merge "changes the API setChannelMaxPowers from hide API to system API" into main
Zhanglong Xia   authored and   Gerrit Code Review   commited 2024-08-26 14:03:50 +00:00
b5ddf3a056
[Thread] rename BorderRouterConfiguration to OtDaemonConfiguration
This is a no-op name refactoring CL to prepare for supporting Thread
in mobile use cases where Thread won't operate as a Border Router.

Flag: EXEMPT AIDL interface change (plus it just changes names)

Change-Id: Ib27bcb5b9cd5e9d04db720fde356be15e90068fa

Kangping Dong   commited 2024-08-26 08:27:35 +00:00
3c222a895a
Merge "Inform DNS resolver whether DDR is enabled." into main
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2024-08-26 06:43:19 +00:00
ea68942848
Merge "Import absl-py library from codebase" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-08-26 03:37:07 +00:00
1c1af76ff1
changes the API setChannelMaxPowers from hide API to system API
This CL changes the hiden API `setChannelMaxPowers` to system API
to allow the privilege app to set the max power of each Thread channel.

Bug: b/346686506
Test: atest CtsThreadNetworkTestCases
Change-Id: I1089a4a315971c3bca8ec688a02143ddec93d039

Zhanglong Xia   commited 2024-08-26 10:07:36 +08:00
5bbfd91b04
Merge "Add bool type to Struct.java." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-08-23 20:31:53 +00:00
5884049cbd
Add bool type to Struct.java.
Bug: 361492282
Test: TreeHugger, atest NetworkStaticLibTests:com.android.net.moduletests.util.StructTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9c6ff0b826c425fc6250e2eb7f844275728f92dd

Maciej Żenczykowski   commited 2024-08-23 19:17:55 +00:00
e87608b523
Use doReturn instead of when().thenReturn
doReturn is less prone to races since when().thenReturn will fail if the
mock is used by other thread between when() and thenReturn()).

Bug: 337473824
Test: LocationPermissionCheckerTest
Change-Id: Ie07f3f3cf23b57296a7db4fb9296b84be5b57214

Motomu Utsumi   commited 2024-08-23 22:39:15 +09:00
7cf1a03ee5
Import absl-py library from codebase
This removes the need of pip install absl-py and
virtual env usage from the tests.

Test: atest NetworkStaticLibHostPythonTests
Bug: N/A
Change-Id: I2259f7702ecc6b5e7b7b23e2bf44fa28a5a2e07b

Junyu Lai   commited 2024-08-23 21:11:30 +08:00
f84b9074e0
Merge "Specify is_fixed_read_only: true for net security mainline trunk stable flag" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-08-23 10:36:25 +00:00
f851ae1e82
Inform DNS resolver whether DDR is enabled.
This is needed to cleanly flag on/off DDR and to ensure that
when it is flagged on, DnsResolver ignores the hardcoded list of
DoH providers and only uses DDR.

Bug: 240259333
Test: updated existing tests
Change-Id: I84c103a5a4d18294b6a4cc3301d0037d1a6673a4

Lorenzo Colitti   commited 2024-08-23 18:23:42 +09:00
7cde306fa3
Specify is_fixed_read_only: true for net security mainline trunk stable flag
Mainline trunk stable flag must specify is_fixed_read_only: true since
server-side flags not supported for mainline in the trunk stable infrastructure
as of now.

Change-Id: Ibb2d599ee655f871f08b36bbc3cd6e286cf0d3c8
Test: TH

Motomu Utsumi   commited 2024-08-23 08:32:24 +00:00
9efd5627c3
Minor Fix in NetworkStatsService
Fix mistakes pointed out in
aosp/3195840 and aosp/3115462:
1. typo of bug id in comments
2. removal of unused funtion
3. removal of redundant blank lines

Test: TH
Bug: 343844995
Change-Id: I932e766c76e9a194d6718f3929bd50215d0b55cb

Junyu Lai   authored and   Yun-Chen Cheng   commited 2024-08-23 06:00:19 +00:00
8640338ad8