Commit graph

108,796 commits

Message SHA1
Merge "bpf netd: pass sdk level into bpf_traffic_account()" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-01-21 16:25:15 -08:00
67cc59db2a
Merge "bpf_helpers: infra for per sdk level bpf programs" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-01-21 15:47:53 -08:00
0d6fccda52
Merge "bpf_helpers: comment adjustment" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-01-21 15:47:53 -08:00
5e96b9f03c
bpf netd: pass sdk level into bpf_traffic_account()
(trivial no-op prep work)

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

Maciej Żenczykowski   commited 2025-01-21 14:59:54 -08:00
1ef91d67c0
Merge "Remove casbor@google.com from remoteauth/OWNERS" into main
Ronald Braunstein   authored and   Gerrit Code Review   commited 2025-01-21 14:32:47 -08:00
87c84be898
bpf_helpers: infra for per sdk level bpf programs
This will allow build time compiling versions of an ebpf program
with sdk level specific behaviour.

The mainline bpfloader already supports loading programs
based on the sdk level, so this builds on that.

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

Maciej Żenczykowski   commited 2025-01-21 14:21:01 -08:00
4b471719ce
bpf_helpers: comment adjustment
Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I91c6267fd61a22e8789912e4bd09f77a8668bd49

Maciej Żenczykowski   commited 2025-01-21 14:20:58 -08:00
88f0c9562c
BpfUtils.h: update kernel comment for 6.13
This behaviour we depend on continues to be present...

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

Maciej Żenczykowski   commited 2025-01-21 12:33:10 -08:00
81430d6640
bpf: support BPF_F_NO_PREALLOC in bpf_map_def.h
Kernel requires maps of type BPF_MAP_TYPE_LPM_TRIE to not be
preallocated, so default enable the flag for these.

But even for non LPM_TRIE maps allow a negative num_entries
value to ask for 'non preallocated' maps.

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

Maciej Żenczykowski   commited 2025-01-20 14:49:44 -08:00
d2459f373c
Merge "Revert "NetBpfLoad: hacky way to make LPM_TRIE bpf maps work."" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-01-20 13:43:27 -08:00
4c0ba60c36
Revert "NetBpfLoad: hacky way to make LPM_TRIE bpf maps work."
This reverts commit dcb2e7496c.

Reason for revert: will use negative size to imply no prealloc instead.

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

Maciej Żenczykowski   commited 2025-01-20 12:10:04 -08:00
c1a9f4ab4c
Adding mapFlags parameter while created BPF maps.
This will allow BPF maps to be created with flag options that are
supported e.g BPF_F_NO_PREALLOC, BPF_F_MMAPABLE and others.

Bug: 387984935
Test: Modified NetBpfLoader to dump the map flags.
Change-Id: Ia13ca5a861e8275e831c2b96f4759d1e8f111963

Sarup Dalwani   commited 2025-01-20 20:01:57 +00:00
5c01da8e19
Merge "Log legacy tether() calls that succeeded" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-01-20 00:04:23 -08:00
81056e4429
Merge changes Ia25b28d5,Ic6bbd8c0 into main
* changes:
  Fix flakes due to tests resetting CarrierConfig
  Fix lint errors in NetworkAgentTest

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-01-19 20:01:08 -08:00
4ab11df911
Fix flakes due to tests resetting CarrierConfig
Some tests use CarrierConfigManager#overrideConfig(subId, bundle) to set
some configs, and then overrideConfig(subId, null) to reset the
override.  However this also resets overrides that may have been set by
the instrumentation, such as ConnectivityTestTargetPreparer /
CarrierConfigSetupTest.

Avoid this by providing a common utility to set and tear down carrier
config, which reset the overrides to the original setting value instead
of clearing all overrides.

Test: atest
Bug: 253698734
Change-Id: Ia25b28d551b62205c52f91e0ffad1b94710c0828

Remi NGUYEN VAN   commited 2025-01-20 11:55:39 +09:00
c7ed1a195a
Fix lint errors in NetworkAgentTest
This change was generated by running the lint tool.

Test: atest
Change-Id: Ic6bbd8c061a02fd8929378777efe603e47bb72b9

Remi NGUYEN VAN   commited 2025-01-20 11:39:40 +09:00
973959fb6f
Merge "Handle POLLERR for RealtimeScheduler" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-01-19 17:45:46 -08:00
67734a0810
Merge "Enhance ApfIntegrationTest to test multiple packet transmission" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-01-17 10:06:05 -08:00
6d76b1a346
Merge "Add default capabilities for empty config" into main
Chris Desir   authored and   Gerrit Code Review   commited 2025-01-17 10:05:13 -08:00
bcbea35fb5
Enhance ApfIntegrationTest to test multiple packet transmission
This change updates the testReplyPing() method in ApfIntegrationTest to
send multiple packets for each received packet. This verifies the VSR-16
requirement that mandates firmware support for multiple
apf_allocate_buffer() calls within a single APF interpreter run, as long
as sufficient RAM is available.

Test: atest CtsNetTestCases:android.net.cts.ApfIntegrationTest
Change-Id: Ibe4a6babd555e4269ab3e98deecb6824610376f3

Jimi Chen   authored and   Yuyang Huang   commited 2025-01-17 22:25:34 +09:00
d4d43fa7eb
Handle POLLERR for RealtimeScheduler
Bug: 386275396
Test: m
Change-Id: Ib2eba5930ef503057b32b702fe32691adad80d9c

Paul Hu   commited 2025-01-17 06:56:54 +00:00
4931bd791f
Fix extra callbacks sent when the timer expires
Several extra callbacks are sent after the first timer expiration
notification. This occurs because data from the FileDescriptor
must be read after the timer expires. Otherwise, expiration
callbacks will continue to be sent, notifying of unread data.

This change also adds TFD_NONBLOCK to timerfd creation to ensure
reading safety.

Test: Manually verify that the callback is sent only once
Change-Id: I30559ed93d0a742b98a58d33d83723f7a155fbd9

Paul Hu   commited 2025-01-17 06:39:48 +00:00
3ad5d4c348
Merge "Add 'automotive-general-tests' to the CtsNetTestCases dependencies" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-01-16 17:12:11 -08:00
efc14696b4
Merge "Run clang-format on ServiceConnectivityJni.cpp" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-01-16 15:58:09 -08:00
33905ee93f
Merge changes I47b6011d,I5da28a6d into main
* changes:
  Rename timerfd functions for consistency
  Remove native prefix for consistency

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-01-16 15:57:19 -08:00
ac004eb0cf
Merge changes from topic "serviceconnectivityjni" into main
* changes:
  Rename net_utils_device_common_timerfdjni to serviceconnectivityjni
  Move TestNetworkService JNI into ServiceConnectivityJni

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-01-16 15:57:10 -08:00
427b05bc58
Add 'automotive-general-tests' to the CtsNetTestCases dependencies
This change adds missing dependancies of CtsNetTestCases to the automotive-general-tests zip

Change-Id: Iba2da89b380214ad785d504a484b0b72b508814d
BUG: 382649664 
Flag: TEST_ONLY

Filip Zakrzewski   commited 2025-01-16 15:25:33 -08:00
c4e71897a5
Merge "Move TimerFdUtils JNI functionality into ServiceConnectivityJni" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-01-16 15:17:39 -08:00
ae44234505
Add default capabilities for empty config
While doing some testing for another change (pa/2844131), I noticed that
an interface in config.xml with no network capabilities listed provided
no internet connection. parseEthernetConfig was updated to provide empty
 config capabilities with the default capabilities (which
 includes NET_CAPABILITY_INTERNET for non test ifaces).

Flag: BUG_FIX
Test: atest ConnectivityCoverageTests
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.ethernet.EthernetTrackerTest

Bug: 352523028
Change-Id: I6f73b0554f95c20fd1912a3c8da2b3c64f2ac4c4

Chris Desir   commited 2025-01-16 14:47:34 -08:00
3133c0a52a
Run clang-format on ServiceConnectivityJni.cpp
Test: TH
Change-Id: I09af1ca8354e52c7ccf598ac2a6e0543fdd4b3cd

Patrick Rohr   commited 2025-01-16 14:28:13 -08:00
68f5e612a7
Rename timerfd functions for consistency
Test: TH
Change-Id: I47b6011dcd8a0a66d89ac80e728951004666daa8

Patrick Rohr   commited 2025-01-16 14:28:13 -08:00
2f1627d3c3
Rename net_utils_device_common_timerfdjni to serviceconnectivityjni
Test: builds and boots
Change-Id: I432da644ab6d212df736913089ff3b52d286ea0e

Patrick Rohr   commited 2025-01-16 14:28:13 -08:00
08bf056370
Remove native prefix for consistency
Test: builds and boots
Change-Id: I5da28a6dcb9c7b7b06f072a9d92b701228cdde5e

Patrick Rohr   commited 2025-01-16 14:28:13 -08:00
9463cd1387
Move TestNetworkService JNI into ServiceConnectivityJni
Test: builds and boots
Change-Id: Ia15833a163604ddbbb9527dff59174f2643daa61

Patrick Rohr   commited 2025-01-16 14:28:13 -08:00
3c14078435
Merge "Update code for Rust 1.83.0" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-01-16 14:24:08 -08:00
4345a36299
Move TimerFdUtils JNI functionality into ServiceConnectivityJni
Test: build and boots
Change-Id: Idb9f8c9979aff43e6e5351d190329e823112e005

Patrick Rohr   commited 2025-01-16 13:04:42 -08:00
4971556451
Do not run NetworkReservationTest in instant mode
The permissions required to run this test are not grantable to instant
apps.

Test: TH
Bug: 388929494
Change-Id: Ifd6f0b10ff2bd7036a4123aebdf9b63037c7d831

Patrick Rohr   commited 2025-01-16 12:09:54 -08:00
fbdead2f5d
L2capNetworkProvider should use its own handler thread
Eventually, this will be started by CS, but it should not reuse the CS
handler thread.

Test: TH
Change-Id: I20dc252d91351cf92724d640e272f28ddc29dbf4

Patrick Rohr   commited 2025-01-16 09:52:35 -08:00
2e3904dc4e
Ensure directory permissions are granted for CT root and version directories
In aosp/3434620 the logic of the DirectoryUtils#makeDir method
was changed to use dir.mkdirs() instead of dir.mkdir(). This
resulted in an issue where the permissions were not properly
set for the CT root directory.

Also, add tests to presubmit set for networksecurity.

Bug: 377276991
Test: atest --test-mapping packages/modules/Connectivity/networksecurity
Change-Id: I8a41224bf425b4ec869dc1ee087e8efda4644423

Sandro Montanari   commited 2025-01-16 10:52:52 +00:00
5cc68e42f8
Merge "Add NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED to L2CAP network offer" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-01-15 22:55:59 -08:00
a122d74221
Merge "Add toString to L2capNetworkSpecifier" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-01-15 17:46:18 -08:00
074b213907
Update code for Rust 1.83.0
Test: m rust
Bug: 384401387
Change-Id: Id14002c889960c6c80d290090e329575fa363eff

Chris Wailes   commited 2025-01-15 17:24:41 -08:00
1fd2b309e3
Merge "Add 'automotive-general-tests' in Android.bp of CtsNetTestCases" into main
Filip Zakrzewski   authored and   Gerrit Code Review   commited 2025-01-15 17:04:45 -08:00
b406e18b04
Merge "Add 'automotive-general-tests' in Android.bp of CtsNetTestCasesUpdateStatsPermission" into main
Filip Zakrzewski   authored and   Gerrit Code Review   commited 2025-01-15 17:04:42 -08:00
177faec9e6
Add 'automotive-general-tests' in Android.bp of CtsNetTestCasesUpdateStatsPermission
This change helps make Automotive presubmit builds faster. There are no side effects of this change elsewhere, it requires builds to configure said target to take effect and if configured this change only make the test show up in the automotive zip file

BUG: 382649664
Flag: TEST_ONLY

Change-Id: Ibe0cb51911449eb0ae5160c1170c2a28add3be98

Filip Zakrzewski   commited 2025-01-15 16:52:21 -08:00
40371ec964
Add 'automotive-general-tests' in Android.bp of CtsNetTestCases
This change helps make Automotive presubmit builds faster. There are no side effects of this change elsewhere, it requires builds to configure said target to take effect and if configured this change only make the test show up in the automotive zip file

BUG: 382649664
Flag: TEST_ONLY

Change-Id: I85d36c2f1a9f9ba99c4d7d9ea402fa035d74ae79

Filip Zakrzewski   commited 2025-01-15 16:52:14 -08:00
fa42769464
Merge changes Iddc8975b,I2cedd584 into main
* changes:
  Add diagnostics on failure for PrivateDns test
  Wait for default route for wifi check

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-01-15 00:45:15 -08:00
ba7089227f
Merge "Address lint warnings in diagnostics collector" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-01-15 00:13:15 -08:00
cbf9b1163e
Log legacy tether() calls that succeeded
Log extra enums to audit usages of Wifi/P2P tether() that successfully
resulted in tethering on an interface.

Bug: 216524590
Test: build
Change-Id: Ia0d2a8fc1e508263c597bfd40fbefe5b49ec15d5

Quang Anh Luong   commited 2025-01-15 16:15:37 +09:00
1e60b9a0ea
Add diagnostics on failure for PrivateDns test
IWLAN on U 24Q2 release may cause this test to fail, but this was
supposed to be addresed by CarrierConfigSetupTest already.

Add diagnostics on failure to figure out if the IWLAN config is as
expected.

Test: atest
Bug: 253698734
Change-Id: Iddc8975bb473979f9c2769cd178ef75644b82aa7

Remi NGUYEN VAN   commited 2025-01-15 16:12:40 +09:00
4d47b52f6d