Commit graph

105,221 commits

Message SHA1
Thread: fill in ticks in active timestamp
This commit fills in the ticks of active timestamp of randomly generated
dataset as defined in Thread spec.

Bug: 347838683
Change-Id: I5d8ba3ca7728e1890996fdd64198f7bc90bfb1fa

Yakun Xu   commited 2024-06-26 15:56:57 +08:00
e2ab96f3c7
Merge changes I47606693,Ia51bc3ab,Idef1a6d1,Ie6fbc3ee,I55064ee7 into main
* changes:
  Clean up BpfCoordinatorTest after refactors
  Move upstream interface BPF support check to BpfCoordinator
  Refactor BPF map update logic of upstream interface change
  Centralize IP neighbor monitoring in BpfCoordinator
  Get rid of BpfCoordinator#mPollingStarted

KH Shi   authored and   Gerrit Code Review   commited 2024-06-22 12:34:34 +00:00
4c701fbfa0
Merge changes I76b0a7ba,If7308f1a,Ica8faced,Ia8f42ed0,I975afb45, ... into main
* changes:
  Add some documentation to EthernetInterfaceStateMachine
  Add support for link state tracking
  Add unit test class for EthernetInterfaceStateMachine
  Add missing call to add states to state machine
  Make class testable
  Log.wtf if block times out
  Wait on IpClient#onQuit in StartedState#exit
  Use TAG instead
  Introduce CMD_ON_NETWORK_NEEDED and CMD_ON_NETWORK_UNNEEDED messages
  Clean up and document state lifecycle
  Add convenience method for processMessage with no arguments
  Implement NetworkOffer in EthernetInterfaceStateMachine
  Add boilerplate to represent interface states in state machine
  Fix typo in SyncStateMachineTest
  Move SyncStateMachine to staticlibs

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-21 19:01:38 +00:00
58526e4d96
Revert "NetBpfLoad: disable mainline on < U QPR3"
This reverts commit 4b28336a7a.

Fixed trivial comment conflicts in netd/BpfHandler.cpp

This is targetting mainline release M-2024-09.

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

Maciej Żenczykowski   commited 2024-06-21 15:47:00 +00:00
4e4f8720f2
Revert "NetBpfLoad: gently enable mainline"
This reverts commit 231598bc92.

This is targetting mainline release M-2024-09.

Note: left the failure message in netbpfload/netbpfload.33rc
to mention 'netbpfload-failed' and not 'bpfloader-failed'.

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

Maciej Żenczykowski   commited 2024-06-21 15:46:42 +00:00
2afffc2d6a
Add some documentation to EthernetInterfaceStateMachine
Test: documentation only
Change-Id: I76b0a7ba8633fa9328e1d42de7f7208c84871ca8

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
d4c6516b2c
Add support for link state tracking
Currently, TetheringState just ignores these callbacks (though it must
return HANDLED, otherwise a wtf is logged). This is in line with what
EthernetTracker currently does.

Test: EthernetInterfaceStateMachineTest
Change-Id: If7308f1aa4b333552a79dfe05864c5cef1621582

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
0129a7a11e
Add unit test class for EthernetInterfaceStateMachine
This currently just invokes the constructor and does nothing else.
EthernetInterfaceStateMachine does not currently provide a way to
transition out of LinkDownState.

Test: run test
Change-Id: Ica8faced0abe33bb70ec5e3f950bc0af75f78f16

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
7bd5e6dca6
Add missing call to add states to state machine
Test: EthernetInterfaceStateMachineTest
Change-Id: Ia8f42ed03a8d20bd02be2c587976db48e6b8cccd

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
990ea86b46
Make class testable
Reuses EthernetNetworkFactory.Dependencies.

Test: mm
Change-Id: I975afb45a84b12e8660ac6b94d97410abb3c7aaa

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
e3e9d4bbdc
Log.wtf if block times out
Test: mm
Change-Id: I28e5bd8d208fa77ad04c67e3f66ea36c20ff8917

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
903f230825
Wait on IpClient#onQuit in StartedState#exit
This does make the entire operation synchronous, but also temporarily
blocks the handler thread (it is however what EthernetNetworkFactory
currently does). If that becomes an issue, we can consider adding a
StoppingState.

Test: mm
Change-Id: I799fb027d6eda4106633a047bf13674190ad0e68

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
49cea0f80d
Use TAG instead
Test: mm
Change-Id: Ic0fa5d6c99e804b32f4b47fc2142b6f51c460953

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
2bdae824c5
Introduce CMD_ON_NETWORK_NEEDED and CMD_ON_NETWORK_UNNEEDED messages
While the parent state (NetworkOfferExtendedState) registers (and
unregisters) the offer, its child states handle the resulting needed /
unneeded messages. Since SyncStateMachine logs WTF if a message is
processed that is not handled by the current state (or any of its
parents), this provides some protection against receiving unexpectected
needed / unneeded messages.

Test: mm
Change-Id: I5d322c9d3b9cea911e1435ef118a3fb03f7d537a

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
a403056f70
Clean up and document state lifecycle
This renames existing states and makes RunningState a child of
StartedState. StartedState's purpose is managing the IpClient lifecycle,
so when the state machine transitions to RunningState, there is
guaranteed to be an IpClient instance. RunningState will then
startProvisioning and register a NetworkAgent on provisioning success.

Test: builds
Change-Id: I7fa41a9be06feaa9cbe78e344242bcedbe91e7ed

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
9cc02c2e01
Add convenience method for processMessage with no arguments
Similar to StateMachine, this CL adds a convenience method for
processMessage that sets arg1 and arg2 to 0, and obj to null.

Test: SyncStateMachineTest
Change-Id: I7f5b9c0403c1abf02d03fd26bb2a16c53712c3bb

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
38c6f7d5ce
Implement NetworkOffer in EthernetInterfaceStateMachine
This approximately does the equivalent of
NetworkInterfaceState#registerNetworkOffer,
NetworkInterfaceState#unregisterNetworkOfferAndStop, and
NetworkInterfaceState#EthernetNetworkOfferCallback.

Test: TH
Change-Id: I9963e4bd08ab00910fafb258e7213ab01894926a

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
3900b0606c
Add boilerplate to represent interface states in state machine
Adds empty boilerplate states to represent ethernet interface states
(currently tracked in NetworkInterfaceState) in a StateMachine.

Test: TH
Change-Id: I1041dc577a9c41b44272dfd534abe705220ff3e0

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
4e6679153a
Fix typo in SyncStateMachineTest
Test: TH
Change-Id: Ibeea98446135e16b8ce9f63e0651075b3c109669

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
6e7c49de1e
Move SyncStateMachine to staticlibs
Test: mm
Change-Id: I51685a454a3d0fab578fef1eeb42d600adef06e6

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
aa06b2bf8e
Revert "bpf_progs: introduce mainline loaded non-critical gentle.o"
This reverts commit 083cce9bf9.

This is targetting mainline release M-2024-09.

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

Maciej Żenczykowski   commited 2024-06-21 15:14:43 +00:00
4d6d7aafe8
Revert "Add a temporary hack to CS to report netbpfload result"
This reverts commit fe956d9189.

This is targetting mainline release M-2024-09.

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

Maciej Żenczykowski   commited 2024-06-21 15:14:33 +00:00
8e7276b482
Revert "Add a Log.wtf() on user builds to test Pitot reporting pipeline"
This reverts commit 9161b153b4.

This is targetting mainline release M-2024-09.

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

Maciej Żenczykowski   commited 2024-06-21 15:14:20 +00:00
2a911d6c18
Merge "Update ApfIntegrationTest to use new ApfV4Generator constructor" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-21 13:29:23 +00:00
81837d0766
Clean up BpfCoordinatorTest after refactors
Removed the use of a real IpServer instance in BpfCoordinatorTest,
as it is no longer needed after the refactors in aosp/2716773 and
aosp/3113123.

Test: atest TetheringTests
Bug: 294025403
Change-Id: I4760669372275a0165f4980705e328c80e0649a5

KH Shi   commited 2024-06-21 11:35:39 +00:00
572b784fdc
Move upstream interface BPF support check to BpfCoordinator
Removed upstream interface BPF support check from IpServer and moved
it to BpfCoordinator. The support check can be performed directly in
BpfCoordinator using the interface name.

Test: atest TetheringTests
Bug: 294025403
Change-Id: Ia51bc3ab18dd21afdca9db9199fa060aab68f768

KH Shi   commited 2024-06-21 11:35:37 +00:00
582df23c7b
Refactor BPF map update logic of upstream interface change
Move upstream interface change handling for BPF map updates from
IpServer to BpfCoordinator. BpfCoordinator now manages all BPF map
updates.

Test: atest TetheringTests
Bug: 294025403
Change-Id: Idef1a6d1a16a35603e0b476bfdbe6a234f39f4be

KH Shi   commited 2024-06-21 11:32:39 +00:00
9174207bb6
PacketBuilder: add IPv6 fragment packets support
Add IPv6 fragment packets support in PacketBuilder class, refer to
https://tools.ietf.org/html/rfc2460.

Bug: 285124667
Test: atest NetworkStaticLibTests
Change-Id: Ie898f8a4847f12677b11dfaa4db26dc4e168a68a

KH Shi   commited 2024-06-21 10:47:33 +00:00
d83596f567
Update ApfIntegrationTest to use new ApfV4Generator constructor
Test: TH
Change-Id: If33f5302398ffb93eb3a811ddf2b94282d3318fa

Yuyang Huang   commited 2024-06-21 19:22:26 +09:00
8a4f6e810c
Remove unused import from EthernetTetheringTestBase
Bug: 285124667
Test: m
Change-Id: I9d89ae70ec7d4b52431f8bc992a7cdc1df85d202

KH Shi   commited 2024-06-21 01:57:14 +00:00
f093d22fcc
Merge "Baseline Lint FlaggedApi violations" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-20 12:11:15 +00:00
7466a95f8b
Fix a comment in MdnsAdvertiser.java
As suggested in b/344799768, we should use 'UID' instead of 'user'.

Bug: 344799768
Change-Id: I1dff7f9f5a0578d2b706dd807b23b07a8103eca1
Test: None

Handa Wang   commited 2024-06-20 10:55:33 +00:00
3034cc60bd
Merge "Move tether_utils into utils folder" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-20 07:22:32 +00:00
fada36681a
Baseline Lint FlaggedApi violations
The Lint FlaggedApi checks are currently configured as warnings. Add
existing violations to baselines files to prepare for turning the
FlaggedApi checks into errors.

Bug: 303434307
Test: treehugger
Flag: EXEMPT not possible to flag baseline changes
Merged-In: I990ce57cd5cdac44ee8b93565b45aa15790ad697
Change-Id: I990ce57cd5cdac44ee8b93565b45aa15790ad697

Mårten Kongstad   commited 2024-06-20 09:05:51 +02:00
4ece737f4f
Add "no-op refactors" reviews for delegated reviewers
As per discussion, also expand the "NsdManager" exemption to be more generic.

Change-Id: I708f44c8546d6c68db9c8a6763bbf6ebb0340883
Test: m

Remi NGUYEN VAN   commited 2024-06-20 06:29:09 +00:00
3784fa6642
Merge "Increase timeout for waiting for physical interfaces to show up" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-06-19 10:46:28 +00:00
0ca920b40b
Merge "Introduce TETHERING_VIRTUAL type" into main
Seungjae Yoo   authored and   Gerrit Code Review   commited 2024-06-19 09:10:15 +00:00
a05cdee22f
Merge "bpf: extend cgroup hooks to older kernels" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-19 08:01:15 +00:00
c4ada1c953
Introduce TETHERING_VIRTUAL type
Bug: 340376953
Test: Presubmit
Change-Id: I0714b62ebfc63fc966d7873ebdd68ae72c015bc4

Seungjae Yoo   commited 2024-06-19 16:18:51 +09:00
07b8fe1f92
Merge "Remove SkipMainlinePresubmit annotation from testIsPrivateDnsBroken." into main
Xiao Ma   authored and   Gerrit Code Review   commited 2024-06-19 07:04:50 +00:00
3fe617dfdb
Increase timeout for waiting for physical interfaces to show up
200ms does not seem to be enough for our test infra. There have been test failures where tethering test was started on devices with physical interfaces that were available for tethering (i.e. cuttlefish on Android R and S).

This change increases the timeout to 1000ms, which unfortunately means the tests will take a bit longer.

Test: TH
Bug: 348044867
Change-Id: I5fe541cf1db1097040066baa73ba949533718ef6

Patrick Rohr   commited 2024-06-19 03:43:33 +00:00
88be5a3a3a
bpf: extend cgroup hooks to older kernels
We adjust and extend the trivial programs on:
  {connect,recvmsg,sendmsg}{4,6}
  inet_release
  {g,s}etsockopt
so that they also work on older kernels.

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

Maciej Żenczykowski   commited 2024-06-18 17:55:54 -07:00
05ebcf0e9d
Merge "Increase time buffer to reduce flakiness in filter age test" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-06-18 11:33:27 +00:00
39eb70b0c9
Increase time buffer to reduce flakiness in filter age test
Added a larger time buffer to the filter age difference check in
testFilterAgeIncreasesBetweenPackets to mitigate potential flakiness
caused by delays in the second ping reply.

Bug: 347641209
Test: TH
Change-Id: I1a7698297bf36a295b1428c92bf83158539bb867

Yuyang Huang   commited 2024-06-18 11:11:19 +00:00
89cafef056
Remove SkipMainlinePresubmit annotation from testIsPrivateDnsBroken.
testIsPrivateDnsBroken isn't flaky any more, remove the
SkipMainlinePresubmit annotation.

Bug: 289879947
Test: atest ConnectivityManagerTest#testIsPrivateDnsBroken --iterations 100
Change-Id: I402153fa09144a96a500c96ecf7c89f41702bd0d

Xiao Ma   commited 2024-06-18 18:57:48 +09:00
f07fe9372c
Merge "[Thread] add annotations for unit test NsdPublisherTest" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-18 06:45:16 +00:00
8e53836647
Merge "[Thread] reduce JNI code for setting up the ICMPv6 socket" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-18 05:03:15 +00:00
5637480c2c
[Thread] reduce JNI code for setting up the ICMPv6 socket
Bug: 316103631
Test: atest ThreadNetworkIntegrationTests

Change-Id: I64a0cb22d4ed2208328123d8dace3463a92af01e

Handa Wang   commited 2024-06-18 02:40:36 +00:00
0348cbe874
[Thread] add annotations for unit test NsdPublisherTest
Change-Id: Ic4e12b21bb888f0e4f892e9a368a64d769120cc1
Test: atest NsdPublisherTest

Handa Wang   commited 2024-06-18 00:51:03 +00:00
89c32ea0c8
Merge changes I54451c4a,Ib0a2518b into main
* changes:
  Inline runUdp4Test
  Create a tethered interface request in setUp

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-18 00:05:12 +00:00
e9e393cf23