Commit graph

91,006 commits

Message SHA1
Merge "Cleanup modifyRoutes" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2023-10-27 13:11:29 +00:00
9fea45db05
Merge changes Ibe22b300,I0b0f0bf1 into main
* changes:
  SyncSM08: handle IpServer requestEnableTethering callback in mainSM
  SyncSM07.1: Add a test that shows tethering restarts when disabling

Mark Chien   authored and   Gerrit Code Review   commited 2023-10-27 08:50:04 +00:00
2c7e2b8448
Merge "Pass upstream prefixes to bpf tethering offload" into main
KH Shi   authored and   Gerrit Code Review   commited 2023-10-27 07:23:52 +00:00
f92d211c71
Cleanup modifyRoutes
This is no longer used out of this file, and should not be.

Test: Build
Change-Id: I531191b4afbda39a5fbaf1f483d13068f86d17f1
Merged-In: Ief0a79883bcc2c5493807c548cb71ef655abed23

Chalard Jean   authored and   Jean Chalard   commited 2023-10-27 06:53:36 +00:00
ac5e4cf025
Merge "Add forwarding methods to RoutingCoordinator" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2023-10-27 05:12:07 +00:00
23376e6fe7
Merge "Add public getter for IpPrefix" into main
Patrick Rohr   authored and   Gerrit Code Review   commited 2023-10-26 18:21:07 +00:00
149868f1b1
Merge changes I34903b57,Ic818aa55 into main
* changes:
  SyncSM07: Replace IpServer's state machine with StateMachineShim
  SyncSM06: Add StateMachineShim

Mark Chien   authored and   Gerrit Code Review   commited 2023-10-26 16:44:44 +00:00
a055890412
Merge "Support NetworkStatsEventLogger" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2023-10-26 14:17:21 +00:00
aacd7d8d8c
Pass upstream prefixes to bpf tethering offload
BPF needs upstream prefixes information to filter spoofing IPv6 source
addresses carried in downstream traffic.

We retrieve prefixes from upstream interface's LinkProperties and pass
it to the BpfCoordinator. Forwarding rules will also be updated when
upstream interface's IPv6 link addresses change.

Test: atest TetheringTests
Bug: 261923493
Change-Id: If8cfc3b191e520ca838654d1b5211ab9e9ec021d

KH Shi   commited 2023-10-26 13:13:38 +00:00
3f738fcd3d
Add forwarding methods to RoutingCoordinator
Test: RoutingCoordinatorServiceTest
      TetheringTest
Change-Id: Ic3b36ddc236e8615e7d931b6e526556bbd2dac17

Chalard Jean   commited 2023-10-26 20:18:48 +09:00
55ccfe19e2
SyncSM08: handle IpServer requestEnableTethering callback in mainSM
This can make it easier to adopt SM shim replacement in follow up change,
as both SyncSM and AsyncSM will process the same message without any
difference.

This change also fix a problem that bring up downstream before it's
IpServer completely disabled.

Previous:
CMD_NOTIFY_PREFIX_CONFLICT -> requestEnableTethering(false) ->
requestEnableTethering(true) -> IpServer stopped ->
reportTetherStateChanged(downstream inactive) -> IpServer started
-> reportTetherStateChanged(downstream active)
New:
CMD_NOTIFY_PREFIX_CONFLICT -> requestEnableTethering(false) ->
IpServer stopped -> reportTetherStateChanged(downstream inactive)
-> requestEnableTethering(true) -> IpServer started
-> reportTetherStateChanged(downstream active)

Test: atest MtsTetheringTestLatestSdk
Change-Id: Ibe22b300c56125359f4fa452bd01a0a2381fda23

Mark   commited 2023-10-26 09:28:22 +00:00
5cc386bdef
SyncSM07.1: Add a test that shows tethering restarts when disabling
When tethering restarts due to an IP conflict, it starts to
bring up downstream before its IpServer is completely disabled.

Test: atest TetheringTests
Change-Id: I0b0f0bf1bb9ac8421c05fe512d5082d095fa7180

Mark   commited 2023-10-26 09:26:37 +00:00
d81f6ef4db
SyncSM07: Replace IpServer's state machine with StateMachineShim
A simple replacement without changing any behavior.

Test: atest TetheringTests
Change-Id: I34903b57df68081e974163edec82a851ee4ccc98

Mark   commited 2023-10-26 09:26:15 +00:00
2150296476
SyncSM06: Add StateMachineShim
Test: atest StateMachineShimTest

Change-Id: Ic818aa55e7e0fd7a62dfce50a6ad719e6e1c44ec

Mark   commited 2023-10-26 09:24:55 +00:00
2ec1595d0b
Merge "Clean up obsolete aliases for Truth." into main
Krzysztof Kosiński   authored and   Gerrit Code Review   commited 2023-10-26 09:07:59 +00:00
93196302b1
Merge "[Thread] graduate CtsThreadNetworkTestCases from postsubmit" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-10-26 08:48:27 +00:00
24ae5c2d06
Merge "[Thread] make the Manager and Controller class 'final'" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-10-26 07:18:06 +00:00
077e444720
Clean up obsolete aliases for Truth.
Bug: 255714762
Test: presubmit
Change-Id: I1a6394f6ff1cd56fac0f7a340857fdaee92fcbab

Krzysztof Kosiński   commited 2023-10-26 07:13:22 +00:00
4656f54cdd
Merge "move convenience methods from BpfMap to IBpfMap" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2023-10-25 22:54:04 +00:00
ad3badf7a8
Merge "remove dead portions of BpfUtils.java" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2023-10-25 22:53:49 +00:00
bee431759a
Add public getter for IpPrefix
Test: TH
Change-Id: I8d2c8e1a6b76f04257f2137c1ce893b59e52e420

Patrick Rohr   commited 2023-10-25 15:32:06 -07:00
6f0dc0dc95
Merge "netbpfload: prep work to support <U" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2023-10-25 21:14:08 +00:00
906cac004f
move convenience methods from BpfMap to IBpfMap
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5f4ee8bdc3aaff1f306a36126e6e812b486e312b

Maciej Żenczykowski   commited 2023-10-25 11:51:40 -07:00
74641d82c4
netbpfload: prep work to support <U
proc file writes were only moved from .rc into bpfloader binary in U.

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

Maciej Żenczykowski   commited 2023-10-25 18:40:53 +00:00
f33f12876f
remove dead portions of BpfUtils.java
(mostly to improve code coverage)

We can always revert if it ever turns out this is useful,
but I'd prefer for cgroup attach to be a once-at-boot
thing and handled either from bpfloader or the netd updatable
which are both directly C++ code.

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

Maciej Żenczykowski   commited 2023-10-25 17:40:35 +00:00
de9d367ab2
[Thread] graduate CtsThreadNetworkTestCases from postsubmit
Bug: 297729075
Test; build and pass the presubmit

Change-Id: Ie90fd5dfd1d77ed45b39c527d37954f5ff6facd8

Kangping Dong   commited 2023-10-25 22:38:00 +08:00
706c234aeb
[Thread] make the Manager and Controller class 'final'
Per the API review council, the classes should be "final" by default

Bug: 301076593
Test: build && atest CtsThreadNetworkTestCases
Change-Id: I85f0b4fabe5b1bcec2be052620b38a07c58181d7

Kangping Dong   commited 2023-10-25 22:03:11 +08:00
5e1d430d33
Merge "[Thread] add Thread Operational Dataset API" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-10-25 12:24:16 +00:00
898ed69359
Support NetworkStatsEventLogger
The performPoll method in the NetworkStatsService can be called
for many reasons, such as RAT changed events, LinkProperties
changed events, open session method calls, forceUpdate method
calls, etc.
However, the current logging is not sufficient to trace down
the caller of performPoll. This makes it difficult to debug
frequent poll issues or performance problems.

Adding debug log to logcat is not an option, given that
performPoll might run several times per second by system server
callers.

This change adds a reason code to the performPoll method and
a helper class to log performPoll events. This will allow us
to track down the caller of performPoll and better understand
why it is being called frequently or causing performance
problems.

This change also introduces a PollEvent object, which can be
used to put related information in subsequent changes when
logging.

Sample output:
Poll counts per reason:
  DUMPSYS: 0
  FORCE_UPDATE: 6
  GLOBAL_ALERT: 0
  NETWORK_STATUS_CHANGED: 3
  OPEN_SESSION: 0
  PERIODIC: 1
  RAT_CHANGED: 1
  REG_CALLBACK: 3
  REMOVE_UIDS: 0
  UPSTREAM_CHANGED: 1

Recent poll events:
  2023-10-04T02:47:12.937370 - Poll(flags=3, PollEvent{reason=REG_CALLBACK})
  2023-10-04T02:47:13.178559 - Poll(flags=3, PollEvent{reason=FORCE_UPDATE})

Test: manual
Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsEventLoggerTest
Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest
Bug: 301141955
Change-Id: Ic6d0543ccdef12493385f45200199854b841a26b

Junyu Lai   commited 2023-10-25 19:23:35 +08:00
41b37349f3
[Thread] add Thread Operational Dataset API
Design doc: go/thread-android-api
Android FR: b/235016403

Bug: 262683651
Change-Id: Icbd4ee4150e3fd78df627c2e726c259e7ee50871

Kangping Dong   commited 2023-10-25 18:13:07 +08:00
7fea5fa6a2
Merge "Add a routing coordinator class" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2023-10-25 09:13:16 +00:00
4e47533688
Merge "Fix testRequestDownstreamAddressWithoutUsingLastAddress flaky" into main
Mark Chien   authored and   Gerrit Code Review   commited 2023-10-25 03:41:10 +00:00
cc26d678f2
Merge changes Idce2024f,I7e009073,I29fe506c,I37b2a0b8,Iccb4e3ec into main
* changes:
  Add toString for more consistent logging to IaPrefixOption
  Create IpPrefix in IaPrefixOption constructor
  Add @Computed annotation to Struct
  Remove check that preferred lifetime >= t2
  Remove IA prefix option option-code from public constructor

Patrick Rohr   authored and   Gerrit Code Review   commited 2023-10-25 02:14:30 +00:00
49967eab24
Merge "Revert "Revert "[BR07.1] Expose setDataSaverEnabled from Connect..."" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2023-10-25 01:59:12 +00:00
0cfaea8d98
Merge "move bpfloader.rc into p/m/C" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2023-10-25 00:07:02 +00:00
4530eaaa9e
Add toString for more consistent logging to IaPrefixOption
toString() approximately follows the format of tcpdump logging ND
options.

Test: TH
Change-Id: Idce2024f44bba5427dc0f88128b87b367c09ccb6

Patrick Rohr   commited 2023-10-24 15:07:14 -07:00
8f77f016df
Create IpPrefix in IaPrefixOption constructor
The constructor is invoked during Struct#parse() at which point we might
as well try to create the IpPrefix object which will be used later. If
this fails for some reason (UnknownHostException or ClassCastException),
the prefix is bogus and should not be used.

Test: TH
Change-Id: I7e0090735022d017ba11aa85266ba19e65807da7

Patrick Rohr   commited 2023-10-24 15:04:19 -07:00
9f03f9e6e5
Add @Computed annotation to Struct
@Computed will ignore "computed" fields from struct parsing. Fields
cannot both be annotated by @Computed and @Field (though there
currently is no check for this).

Test: builds
Change-Id: I29fe506c5e3be4cc50fdaf3a07fc5e922111165b

Patrick Rohr   commited 2023-10-24 15:03:35 -07:00
3b2c559149
doc: add bpfloader rc files from previous Android releases
Stripping comments since those are not interesting
for the purposes of what these things actually do.

Doing R+ since tethering apex only supports R+ now.

Generated via:
  (cd ../../../../../system/bpf && git cat-file -p remotes/aosp/android11-release:bpfloader/bpfloader.rc; ) | egrep -v '^ *#' > bpfloader-sdk30-11-R.rc
  (cd ../../../../../system/bpf && git cat-file -p remotes/aosp/android12-release:bpfloader/bpfloader.rc; ) | egrep -v '^ *#' > bpfloader-sdk31-12-S.rc
  (cd ../../../../../system/bpf && git cat-file -p remotes/aosp/android13-release:bpfloader/bpfloader.rc; ) | egrep -v '^ *#' > bpfloader-sdk33-13-T.rc
  (cd ../../../../../system/bpf && git cat-file -p remotes/aosp/android14-release:bpfloader/bpfloader.rc; ) | egrep -v '^ *#' > bpfloader-sdk34-14-U.rc
  (cd ../../../../../system/bpf && git cat-file -p remotes/aosp/main:bpfloader/bpfloader.rc;              ) | egrep -v '^ *#' > bpfloader-sdk34-14-U-QPR2.rc

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

Maciej Żenczykowski   commited 2023-10-24 19:26:55 +00:00
b0940279c4
Remove check that preferred lifetime >= t2
For a single address, DHCPv6 won't work well (i.e. potentially lose provisioning) if
the preferred lifetime is lower than t2. However, this might be a valid
scenario in a renumbering event in the presence of multiple prefixes.

Additionally, in DHCPv6 it is up to the server to configure the client
correctly.

Test: TH
Change-Id: I37b2a0b89deda85b3f7be29c8f02f685aa6e65f8

Patrick Rohr   commited 2023-10-24 11:44:46 -07:00
dc6c70fd5f
Merge "[Thread] flagging Android Thread APIs" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-10-24 14:26:06 +00:00
9513988323
Add a routing coordinator class
Test: In followup changes : RoutingCoordinatorManagerTest
Change-Id: Ia6811d614e02123a072c7638291828745abae051

Chalard Jean   commited 2023-10-24 22:12:26 +09:00
2fb66f1b28
[Thread] flagging Android Thread APIs
This commit declares the initial "thread_enabled" feature flag and use
this to flag all existing and future Thread system APIs with @FlaggedApi

Bug: 301473012
Test: build
Change-Id: I43f64ce38f7fd0806733b21c4f393e4563e6a467

Kangping Dong   commited 2023-10-24 19:45:04 +08:00
75aa485604
move bpfloader.rc into p/m/C
Generated via:
  cat ../../../system/bpf/bpfloader/bpfloader.rc > netbpfload/netbpfload.rc

(plus changing Android.bp to use it)

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

Maciej Żenczykowski   commited 2023-10-24 02:18:02 -07:00
7da54d9940
Revert "Revert "[BR07.1] Expose setDataSaverEnabled from Connect..."
Revert submission 2799494-revert-2745215-npmsbpf-OBOPDXREUI

Reason for revert: Need to 1. Merge API first. 2. Wait for prebuilt. 3. Merge the caller.

Reverted changes: /q/submissionid:2799494-revert-2745215-npmsbpf-OBOPDXREUI

Change-Id: Icd5f3d40595a0d2a221b016cec70568bf3597c16

Junyu Lai   commited 2023-10-24 07:30:23 +00:00
df210365fe
Merge changes I427360f6,Ie6dbbe22 into main
* changes:
  SyncSM05.1: add testMultiDepthTransition
  SyncSM05: add SyncStateMachineTest

Mark Chien   authored and   Gerrit Code Review   commited 2023-10-24 06:50:43 +00:00
66ef9d35ce
Fix testRequestDownstreamAddressWithoutUsingLastAddress flaky
The problem is that the test releases mHotspotIpServer’s prefix before testing mUsbIpServer, which means that mUsbIpServer might choose the same address as mHotspotIpServer’s.

To fix this, we need to test that mUsbIpServer and mHotspotIpServer have different addresses before calling releaseDownstream(mHotspotIpServer).

Change-Id: Id7f7bbfeda841ec9b97e24c0f11893fa37b9ef54
Test: TH
Bug: 300127195

Mark Chien   commited 2023-10-24 06:16:03 +00:00
239860a4d6
Merge "[BR01.1] Support BpfNetMapsReader" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2023-10-24 05:56:33 +00:00
a62eed380c
Merge "Fix arg order to set-package-network-enabled in the CTS preparer" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2023-10-24 05:39:55 +00:00
e7662ae724
Merge "Mock Vpn.setAlwaysOnPackage()." into main
Hansen Kurli   authored and   Gerrit Code Review   commited 2023-10-24 03:11:38 +00:00
a584159ceb