Commit graph

109,970 commits

Message SHA1
Add get exclude all host IPv6 multicast addresses function to apf_utils
Test: atest NetworkStaticLibHostPythonTests
Change-Id: Ib05eaf6ac94e9511a43b4b494eb5935746f50aa7

Jimi Chen   commited 2025-03-19 13:41:41 +00:00
ceefdceafd
Merge changes Idf75e4e9,Idf0435f4 into main
* changes:
  Process enqueued messages from the NAI synchronously.
  Remove the queue on the NetworkAgent side

Jean Chalard   authored and   Gerrit Code Review   commited 2025-03-18 18:07:59 -07:00
5eb96faaf6
Merge changes from topic "enable_btf" into main
* changes:
  Enable BTF for maps loaded by NetBpfLoad
  Add method to get key value type ids
  Add method to load btf into kernel
  Add method to update btf_var_secinfo.offset
  Add method to update btf_type.size for BTF_KIND_DATASEC

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-18 17:04:56 -07:00
f365ac8553
Merge "Enable libbpf logging in bpf loader" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-18 16:46:22 -07:00
0c2cb82014
Merge "Add Ping6 offload for APFv6 multi-devices tests" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-18 16:28:38 -07:00
ef10edc183
Enable BTF for maps loaded by NetBpfLoad
Bug: 403381101
Test: boot
Change-Id: I05194e5a2678de07e3542aa744d2350a6d604ea2

Motomu Utsumi   authored and   Maciej Żenczykowski   commited 2025-03-18 12:15:39 -07:00
1a5cc5b57c
Add method to get key value type ids
BPF_ANNOTATE_KV_PAIR is used to tell the bpf loader about the btf
key_type and value_type of a bpf map.
This CL adds a method to get key value type ids from
BPF_ANNOTATE_KV_PAIR

Bug: 403381101
Test: boot
Change-Id: If308d49b64b38f65991a0a8177e5072d54e2cdf6

Motomu Utsumi   authored and   Maciej Żenczykowski   commited 2025-03-18 12:15:39 -07:00
59b2099360
Add method to load btf into kernel
Bug: 403381101
Test: boot
Change-Id: I9d5aedc13e7f4551eaa97b855496148b573c2176

Motomu Utsumi   authored and   Maciej Żenczykowski   commited 2025-03-18 12:15:39 -07:00
21536e55fc
Add method to update btf_var_secinfo.offset
Bpf loader needs to fix btf_var_secinfo.offset based on ELF's string
section.

Bug: 403381101
Test: boot
Change-Id: I8382d0ee3e0fa7f0a3b825eca9cdcf40ccce9532

Motomu Utsumi   authored and   Maciej Żenczykowski   commited 2025-03-18 12:15:39 -07:00
efe33319f7
Add method to update btf_type.size for BTF_KIND_DATASEC
size in btf_type of BTF_KIND_DATASEC is 0 at compilation time.
So bpf loader needs to update to actual size based on ELF's section
size.

Bug: 403381101
Test: boot
Change-Id: I78fb26a5b8eeb120044b5737667f472fac51d79f

Motomu Utsumi   authored and   Maciej Żenczykowski   commited 2025-03-18 11:46:16 -07:00
b3d3c2ae57
Enable libbpf logging in bpf loader
Bug: 403381101
Test: boot
Change-Id: I039ad8990bb722bfd6eb9f6c4d927b699475b7f6

Motomu Utsumi   authored and   Maciej Żenczykowski   commited 2025-03-18 11:41:17 -07:00
712088dff3
Merge changes Id3eba714,I595ba207 into main
* changes:
  Add CtsTetheringUtils methods for wifi tethering without permission
  Skip stopTetheringRequest tests if tethering isn't supported

Quang Luong   authored and   Gerrit Code Review   commited 2025-03-18 04:12:57 -07:00
e149a49c7d
Merge "clatd: drop system real uid/gid in favour of clat" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-18 03:55:39 -07:00
cb8033b8fb
Merge "Update ApfIntegrationTest for APFv6/v6.1 requirements" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2025-03-18 03:29:33 -07:00
a03654ad70
Process enqueued messages from the NAI synchronously.
As ConnectivityService is ready to accept messages about a network
agent, it should process messages immediately and before messages
from other agents are processed.

This is because of minute ordering issues between the agent process,
ConnectivityService and the network stack. In particular, as the agent
is created, ConnectivityService requests the NetworkMonitor from the
network stack ; while this is happening, the process creating the
agent may have sent a bunch of other messages... including, but not
limited to, disconnects or creation of other agents.

The operative case is the case where a disconnect is in the queue.

agent1.register
    → CS creates the monitor for agent 1
agent1.unregisterAfterReplacement
    → CS enqueues in agent1 pending creation of the monitor
agent2.register
    → CS creates the monitor for agent 2
monitor for agent 1 is created
    → CS posts a message to complete agent 1 creation
monitor for agent 2 is created
    → CS posts a message to complete agent 2 creation
agent 1 creation completes
    → CS re-posts the unregisterAfterReplacement message
agent 2 creation completes
...and this is where things fail, because unregistering agent 1
isn't processed yet. If they use the same interface (which is
a common use case for unregisterAfterReplacement) then this
creation will fail.

To address this, this patch will process all agent1 messages
synchronously as the creation completes. It will solve the case
above, and it passes all tests for early network creation.

However, it is worth noting that this is not actually correct,
because it does not guarantee that all messages are processed
in order. Namely, two agents have separate queues and
therefore if they send interleaved messages while CS is
waiting for the NetworkMonitor to be created, the order of
these messages will be lost. e.g.

agent1.register
agent2.register
agent1.unregisterAfterReplacement

The case above SHOULD fail if the agents have the same
interface, but with this patch it will likely succeed because
the call to agent1.unregisterAfterReplacement will be received
while the two NetworkMonitor are being created, and then
be processed as agent1 finishes registration.

The correct change, therefore, would really enqueue all
messages when *any* agent (of the same process at least)
is being created. However, it is arguable whether it's worth
building that change over this one, and it is even arguable
whether the behavior of this here change might not be
better, insofar as two agent messages are generally
unrelated to each other except for unregistering.

Test: CtsNetTestCases ConnectivityCoverageTests
Change-Id: Idf75e4e96c67a456cf0979a79321603b46e8c99c

Chalard Jean   commited 2025-03-18 19:23:58 +09:00
c2cf5ea823
Remove the queue on the NetworkAgent side
Now that the system server has a queue doing this job,
the queue on the network agent side can be removed.

Test: ConnectivityCoverageTests, CtsNetTestCases
Change-Id: Idf0435f447cfdd28d829a867d1085771837c6f9b

Chalard Jean   commited 2025-03-18 19:23:57 +09:00
391ec5d99c
Merge changes I71abf9d0,I57f25f5e,If6b15419 into main
* changes:
  Reapply "Add a queue system server-side for NetworkAgent"
  Reapply "Unify registration and NM assignment in NAI"
  Reapply "Return the registry in registerNetworkAgent."

Jean Chalard   authored and   Gerrit Code Review   commited 2025-03-18 03:19:07 -07:00
6f2b294fd0
Merge "Add NetworkSecurityUnitTests to tethering-mainline-presubmit" into main
Sandro Montanari   authored and   Gerrit Code Review   commited 2025-03-18 02:49:34 -07:00
9a03538a23
Update ApfIntegrationTest for APFv6/v6.1 requirements
This commit updates ApfIntegrationTest to reflect the latest
requirements for supporting APFv6 and APFv6.1, including their
respective memory requirements.

Test: TH
Change-Id: I29e8e692eaf8e378fea99bda36c752d9d729ed86

Yuyang Huang   commited 2025-03-18 18:10:06 +09:00
4797563fd3
Merge "Collect diagnostics without storage permission" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2025-03-18 02:05:21 -07:00
899737e0e0
Add Ping6 offload for APFv6 multi-devices tests
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: I11b7cef13562884235bd4e505adec1fff381e7ab

Jimi Chen   authored and   Maciej Żenczykowski   commited 2025-03-18 01:49:50 -07:00
c992100a71
Merge "Fix missing function in NetworkStaticLibHostPythonTests" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-18 01:47:31 -07:00
d492666256
Merge "Add IGMPv3 offload for APFv6 multi-devices tests" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-18 01:46:48 -07:00
e634a7da38
clatd: drop system real uid/gid in favour of clat
(minor security improvement)

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

Maciej Żenczykowski   commited 2025-03-18 00:51:59 -07:00
19199ca688
Merge changes from topic "vpn-type-oem-enterprise" into main
* changes:
  Treat new OEM VPN types like the corresponding non-OEM types.
  Add more NativeVpnType AIDL constants for OEM-specific VPNs.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2025-03-18 00:50:13 -07:00
944a1d2855
Merge changes Id80bfca1,I8254c3f4 into main
* changes:
  clatd: one less shutdown log line
  clatd: rework sigterm & error handling

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-18 00:42:37 -07:00
8aff973a30
Merge "clatd: move send_dad out of event_loop() into main()" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-18 00:30:48 -07:00
2413654ad8
Merge "clatd: embed CLATD_VERSION directly in log string" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-18 00:30:47 -07:00
13070faab5
Add CtsTetheringUtils methods for wifi tethering without permission
Device Owner and Carrier-privileged tethering usage relies on starting
tethering without TETHER_PRIVILEGE permission. Add utilities to
CtsTetheringUtils to do this.

Bug: 295979433
Test: atest DeviceOwnerTest TetheringManagerTest
Change-Id: Id3eba71481e27ccfa32f2b0588b8a74c490c5311

Quang Anh Luong   commited 2025-03-18 16:24:39 +09:00
73b09281c0
Skip stopTetheringRequest tests if tethering isn't supported
Bug: 402315643
Test: atest TetheringManagerTest

Change-Id: I595ba20718cd13b7c6b6d66bf540c599ef48304e

Quang Anh Luong   commited 2025-03-18 16:24:31 +09:00
a4d16050f9
Fix missing function in NetworkStaticLibHostPythonTests
This change corrects a missing function error, which was renamed in aosp/3545962.

Test: atest NetworkStaticLibHostPythonTests
Change-Id: I2f51702adfa48f2207ef4dd79f641c8f57d15ac7

Jimi Chen   commited 2025-03-17 23:56:23 -07:00
e6c9b28c2b
Merge "Add carrier privilege utils to CarrierConfigRule" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-17 23:35:22 -07:00
ab6342b70e
Add IGMPv3 offload for APFv6 multi-devices tests
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: Ica704150527bca11b975b6f122678e69eaa04c71

Jimi Chen   commited 2025-03-18 06:21:22 +00:00
8d552bf2c0
Merge "Use non-tentative IPv6 addresses in multi-device test" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2025-03-17 23:04:03 -07:00
d1cbad238c
clatd: one less shutdown log line
less spam

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

Maciej Żenczykowski   commited 2025-03-17 22:53:38 -07:00
0372f296b5
clatd: rework sigterm & error handling
Separate 'running' flag out into 'running' and 'sigterm',
and make SIGTERM handler the only thing that sets 'sigterm'.

running is cleared via catastrophic errors, ie. EOF and ENETDOWN

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

Maciej Żenczykowski   commited 2025-03-17 22:53:32 -07:00
b984f31e55
clatd: move send_dad out of event_loop() into main()
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id74ad4adf861182d928676213c77a24675c358a4

Maciej Żenczykowski   commited 2025-03-17 22:53:26 -07:00
2f96f2c242
clatd: embed CLATD_VERSION directly in log string
Allows for:
  adbz shell strings /apex/com.android.tethering/bin/for-system/clatd | grep 'clat version'
to print:
  Starting clat version 1.7 on %s plat=%s v4=%s v6=%s
instead of:
  Starting clat version %s on %s plat=%s v4=%s v6=%s

(which is more useful for rapid development)

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

Maciej Żenczykowski   commited 2025-03-17 22:53:26 -07:00
1961f673d1
netd bpf: correct comment in NetBpfLoad S+ world (try 2).
fixup for https://android-review.git.corp.google.com/c/platform/packages/modules/Connectivity/+/3548759

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

Maciej Żenczykowski   commited 2025-03-17 22:49:56 -07:00
c07d271e54
Reapply "Add a queue system server-side for NetworkAgent"
Now that faulty Telephony tests have been disabled temporarily
to allow for this bugfix, this can be reverted.
This reverts commit a5ec9b4112.

Test: FrameworksTelephonyTests CtsNetTestCases
Change-Id: I71abf9d02bdd34a4de80157a3f42bdfee6f6617e

Chalard Jean   commited 2025-03-18 14:42:54 +09:00
3c040009c5
Reapply "Unify registration and NM assignment in NAI"
Now that faulty Telephony tests have been disabled temporarily
to allow for this bugfix, this can be reverted.
This reverts commit 30fcf820f9.

Test: FrameworksTelephonyTests CtsNetTestCases
Change-Id: I57f25f5e6481106255df0ab69558e351eb938f68

Chalard Jean   commited 2025-03-18 14:42:50 +09:00
b3a53d0d39
Reapply "Return the registry in registerNetworkAgent."
Now that faulty Telephony tests have been disabled temporarily
to allow for this bugfix, this can be reverted.
This reverts commit 653d5f1ef4.

Test: FrameworksTelephonyTests CtsNetTestCases
Change-Id: If6b1541981803dc84de57b48adb13d40c9997fa0

Chalard Jean   commited 2025-03-18 14:42:39 +09:00
8a97692638
Treat new OEM VPN types like the corresponding non-OEM types.
Bug: 389829981
Test: new CTS tests
Change-Id: I9455a1e00db6fdca3706e83e26daa60db6c73d09

Lorenzo Colitti   commited 2025-03-18 14:34:18 +09:00
fd89cf529a
netd bpf: correct comment in NetBpfLoad S+ world.
Bug: 404398959
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ieefac68fc531868cdf9aa4402cf8cb5a9d1a05ab

Maciej Żenczykowski   commited 2025-03-17 22:15:29 -07:00
4f373e3efa
Merge changes I65d57e0e,I8ca1f7ae into main
* changes:
  [Thread] unregister all country code callbacks when CountryCode is not needed
  [Thread] do not set the country code again if the co-processor doesn't support it

Zhanglong Xia   authored and   Gerrit Code Review   commited 2025-03-17 22:10:39 -07:00
996c612875
Add more NativeVpnType AIDL constants for OEM-specific VPNs.
Test: m
Bug: 389829981
Change-Id: If39e012dcf6388f2d4e7f8d2eebf01410e3f1543

Lorenzo Colitti   commited 2025-03-18 13:13:31 +09:00
d731b8136e
Add carrier privilege utils to CarrierConfigRule
Move the existing helper methods to acquire carrier privileges in
NetworkAgentTest.kt to CarrierConfigRule where it can be reused by other
CTS tests. Also reset the carrier service package override in the rule
cleanup.

Bug: 216524590
Test: atest NetworkAgentTest
Change-Id: Id907a2d641aa61838119e2be65654b9796464498

Quang Anh Luong   commited 2025-03-18 13:05:01 +09:00
a620310e9c
[Thread] unregister all country code callbacks when CountryCode is not needed
This commit unregisters all country code callbacks (WiFi, Telephony and
Location) when the CountryCode module detects that the co-processor
doesn't support setting the country code.

Bug: b/402276117
Test: atest ThreadNetworkUnitTests:ThreadNetworkCountryCodeTest#setCountryCodeNotSupported_returnUnsupportedFeatureError_unregisterAllCallbacks
Change-Id: I65d57e0e826202ad696335200645bf6d78c8b87c

Zhanglong Xia   commited 2025-03-18 03:04:21 +00:00
fe54478761
[Thread] do not set the country code again if the co-processor doesn't support it
Some the co-processors do not support setting the country code. This
commit enables the CountryCode module doesn't set the country again
after it knows that the co-processor doesn't support setting the
country code.

Bug: b/402276117
Test: atest ThreadNetworkUnitTests:ThreadNetworkCountryCodeTest#setCountryCodeNotSupported_returnUnsupportedFeatureError_countryCodeNotSetAgain

Change-Id: I8ca1f7aed3774a086e114e91d8100fb7fe9e3664

Zhanglong Xia   commited 2025-03-18 03:01:59 +00:00
f6187b99c7
Merge "change 'for-system' owner from root to clat" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-17 19:47:33 -07:00
1569bc4cbe