Commit graph

114,410 commits

Message SHA1
Parse IFLA_INET6_FLAGS attr from the RTM_NEWLINK message.
Flag: EXEMPT mainline change
Bug: 293393743
Test: atest NetworkStaticLibTests
Change-Id: I5dc34461a13bd0751d3d7debf1e7412f05958734

Xiao Ma   authored and   Patrick Rohr   commited 2025-09-11 08:35:33 -07:00
d4de245c84
Merge "Add util method to convert StaticIpConfiguration from proto" into main
Chuwei He   authored and   Android (Google) Code Review   commited 2025-09-09 20:20:50 -07:00
32d4c35ae8
Merge "Add util method to convert StaticIpConfiguration to proto" into main
Chuwei He   authored and   Android (Google) Code Review   commited 2025-09-09 20:20:06 -07:00
a599e8670e
Add util method to convert StaticIpConfiguration from proto
This patch adds util methods to convert StaticIpConfiguration from its
proto equivalent, and also adds unit tests to test the conversion.

Test: atest ConnectivityCoverageTests
Bug: 397536853
Flag: EXEMPT mainline

Change-Id: Iba4955efac3b854684f0d0f32b6d5667cebdc265

Chuwei He   commited 2025-09-10 10:34:13 +09:00
c77b880d86
Add util method to convert StaticIpConfiguration to proto
This patch adds util methods to convert StaticIpConfiguration to its
proto equivalent, and also adds unit tests to test the conversion.

Test: atest ConnectivityCoverageTests
Bug: 397536853
Flag: EXEMPT mainline
Change-Id: I1bd5683202bc0e144e195b4915721e7f414c95cf

Chuwei He   commited 2025-09-10 10:34:00 +09:00
014ae496d1
Merge "Log VCN network connected and disconnected events." into main
Hnin Naing   authored and   Android (Google) Code Review   commited 2025-09-09 13:53:29 -07:00
d7f61302da
Merge "Make AddrRegReplyPacket constructor public" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-09-09 13:33:02 -07:00
e3aeb74084
Merge "Log VCN network validated and not validated events." into main
Hnin Naing   authored and   Android (Google) Code Review   commited 2025-09-09 12:58:42 -07:00
4e726a6c7d
Log VCN network connected and disconnected events.
Note that disconnected events are also important for getting correct validated duration metrics. Since they are whenever we teardown the network or VcnConnectionConfig, they will mark the end duration for network validated state also.

Flag: EXEMPT METRICS
Test: atest FrameworksVcnTests, CtsVcnTestCases
Bug: 288600040
Change-Id: I34401568287700e6ab356cff029620b6372354d0

Hnin Naing   commited 2025-09-09 18:51:33 +00:00
af8402b1a0
Merge "Log CHRE NanoApp ID in hexadecimal format." into main
Chris Sabotta   authored and   Android (Google) Code Review   commited 2025-09-09 11:34:50 -07:00
af5ca897dd
Make AddrRegReplyPacket constructor public
So it can be used in tests.

Test: TH
Flag: EXEMPT mainline
Change-Id: Id44e448c1d3c21633fb1ed25a58f663caed61469

Patrick Rohr   commited 2025-09-09 10:56:01 -07:00
93d7c2ae7e
Log VCN network validated and not validated events.
Flag: EXEMPT METRICS
Test: atest FrameworksVcnTests, CtsVcnTestCases
Bug: 288600040
Change-Id: I574db304dc8377e70500f52f52d9b14934e5182a

Hnin Naing   commited 2025-09-09 16:49:17 +00:00
f0c44cb378
Merge "Split switch cases into dedicated handle methods" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-09-08 21:50:11 -07:00
2cb4715d08
Split switch cases into dedicated handle methods
This is a pure refactor to move handling of switch cases in separate
methods. This should make the code easier to follow and reduce
indentation.

Test: atest
Flag: EXEMPT pure refactor
Change-Id: Ie4803ff4de9975314529e4bd3bb92465b2cb7c10

Remi NGUYEN VAN   commited 2025-09-09 11:12:11 +09:00
701b55e20c
Merge "Convert uses of @hide to block tag" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-09-08 04:21:26 -07:00
4910c42dc7
Merge "Remove service-side TrafficStats rate limit cache" into main
Junyu Lai   authored and   Android (Google) Code Review   commited 2025-09-08 01:20:02 -07:00
fe61faa220
Merge "Add conversion util methods for EthernetPortSelector" into main
Chuwei He   authored and   Android (Google) Code Review   commited 2025-09-07 18:37:16 -07:00
54b93bb3c5
Merge "Add conversion util methods for LinkAddress" into main
Chuwei He   authored and   Android (Google) Code Review   commited 2025-09-07 18:36:37 -07:00
41f97eedb2
Merge "Add conversion util methods for MeteredOverride" into main
Chuwei He   authored and   Android (Google) Code Review   commited 2025-09-07 18:36:14 -07:00
1c67fe0789
Merge "Add CTS to validate socket FwMark value" into main
Sewook Seo   authored and   Android (Google) Code Review   commited 2025-09-06 07:11:12 -07:00
7b5ec3e68b
Log CHRE NanoApp ID in hexadecimal format.
Flag: EXEMPT trivial formatting fix
Bug: 443286901
Test: presubmits
Change-Id: I2834ef3e8fa5d10b5e35008c022788092c223479

Chris Sabotta   commited 2025-09-05 12:02:25 -07:00
0879234e61
Merge "Refactor: Use SdkUtil.isAtLeast25Q4 in ConnectivityService" into main
Sarup Dalwani   authored and   Android (Google) Code Review   commited 2025-09-05 08:24:35 -07:00
b7f8fb2557
Fix setDelegateUid unit test.
The assertion that the app was removed from the list was due to
the fact that when adding the same UID twice, the code first
removes it and then re-adds it.

Add a bit more test coverage.

Test: test-only change
Flag: EXEMPT TEST_ONLY
Change-Id: I1eda5be93668ebda7fe2049a2d1ace4e744948e7

Lorenzo Colitti   commited 2025-09-05 19:10:51 +09:00
fb3a754f83
Merge "Add a simple unit test for setDelegateUid." into main
Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-09-05 01:43:41 -07:00
f8741c9611
Add CTS to validate socket FwMark value
Bug: 373280981
Bug: 331139818
Flag: EXEMPT test code
Test: atest android.net.cts.NetworkAgentTest
NO_IFTTT=no change required
Change-Id: I32da9f0c703f4572cd28f85111f199aad3d83541

Sewook Seo   commited 2025-09-04 23:44:51 -07:00
8251949339
Add a simple unit test for setDelegateUid.
This is currently very simple, but should be easy to extend.

Test: test-only change
Flag: EXEMPT TEST_ONLY
Change-Id: Ibcb286dcef0b159f01faf3dd0a17c977a7d60a52

Lorenzo Colitti   authored and   Yuyang Huang   commited 2025-09-05 15:13:23 +09:00
cb91fe2c4a
Merge "Log VCN Gateway Connection safe mode transitions." into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-09-04 15:36:26 -07:00
a1fdea2259
Log VCN Gateway Connection safe mode transitions.
This change adds logging for when a VcnGatewayConnection enters and
exits safe mode.

Flag: EXEMPT METRICS
Test: atest FrameworksVcnTests, CtsVcnTestCases. go/atomtester
Bug: 288600040
Change-Id: I6423b9fe7a1785fe31b363c8acb0b99f8d5f7df3

Hnin Naing   commited 2025-09-04 14:34:38 -07:00
3a3a2376d5
Refactor: Use SdkUtil.isAtLeast25Q4 in ConnectivityService
This change simplifies the code by calling `SdkUtil.isAtLeast25Q4()`
instead of having redundant check in
ConnectivityService.Dependencies#isAtLeast25Q4.

Test: Existing tests pass.
Bug: 443099706
Flag: EXEMPT PURE_REFACTOR
Change-Id: I2c581e24982f8f0df0cb023e2e3e4f37015d2f4a

Sarup Dalwani   commited 2025-09-04 19:05:38 +00:00
acaa7ba313
Merge "Generalize ip address handling in tether4Value bpf structures" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-09-04 11:26:00 -07:00
1f1f284deb
NetBpfLoad: Fail boot if BTF load fails on 4.19+
libbpf ignores BTF load error but this causes boot failure only when BTF
is required for some reasons (e.g. SK_STORAGE).
This CL makes boot fails regardless of the necessity of BTF on 4.19+
kernel

Test: boot kernel on 4.14, 4.19, 5.10, 6.1
Flag: EXEMPT mainline
Change-Id: I0af1e7eedcbea803c22c064ff157700a01307691

Motomu Utsumi   commited 2025-09-04 04:59:00 -07:00
8f3cfccf27
Merge "tcpAccECN: Move static const variables to file scope" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-09-04 04:51:35 -07:00
896a0f15e1
tcpAccECN: Move static const variables to file scope
The symbol name of a static const variable defined within a function
includes a '.' and old kernel BTF ferifier rejects it.
"""
08-29 15:11:27.825     0     0 W         : c3   1287 NetBpfLoad: [377] STRUCT _rodata size=64 vlen=3
08-29 15:11:27.825     0     0 W         : c3   1287 NetBpfLoad: 	tcp_option type_id=343 bits_offset=0
08-29 15:11:27.825     0     0 W         : c3   1287 NetBpfLoad: 	schedcls_ingress_accecn_eth_.new_cnt type_id=346 bits_offset=128 Invalid name
"""

This verifier limitation was relaxed in later kernels by
https://lore.kernel.org/bpf/20230615145607.3469985-1-revest@chromium.org/

Test: Boot on 4.19 kernel && logcat
Bug: 440448408
Bug: 442710894
Flag: EXEMPT tcpAccECN program is not used
Change-Id: If3c993bb6abb1ff8688932d682d909d335f84ca2

Motomu Utsumi   authored and   Maciej Żenczykowski   commited 2025-09-04 04:50:13 -07:00
937c57a2f8
Generalize ip address handling in tether4Value bpf structures
Updated Tether4Value.java to utilize
java.net.InetAddress for relevant IP address fields.
These fields are correspondingly annotated with
Type.IpAddress for BPF map interactions.

Bug: 392509494
Test: atest TetheringTests
Flag: EXEMPT refactor
Change-Id: I6b5b1e176a47b55ad7482be15e4e2d8ee95ab1d1

Sarup Dalwani   authored and   Maciej Żenczykowski   commited 2025-09-04 00:52:31 -07:00
cdd31d8bf3
Add conversion util methods for EthernetPortSelector
This patch adds util methods to convert EthernetPortSelector to and from
its proto equivalent, and also adds unit tests to test the conversion.

Test: atest ConnectivityCoverageTests
Bug: 397536853
Flag: EXEMPT mainline

Change-Id: I0603c7a4004a83448c3d6ec4c1d0c6149708fd9d

Chuwei He   commited 2025-09-04 14:10:04 +09:00
c0293a238b
Add conversion util methods for LinkAddress
This patch adds util methods to convert LinkAddress to and from
its proto equivalent, and also adds unit tests to test the conversion.

Test: atest ConnectivityCoverageTests
Bug: 397536853
Flag: EXEMPT mainline
Change-Id: I66243dc94f9b2619551f957c698b3bc0c285aced

Chuwei He   commited 2025-09-04 14:09:23 +09:00
a9454a1b48
Add conversion util methods for MeteredOverride
This patch adds util methods to convert MeteredOverride to and from
its proto equivalent, and also adds unit tests to test the conversion.

Test: atest ConnectivityCoverageTests
Bug: 397536853
Flag: EXEMPT mainline
Change-Id: Ie19a19c1124e87b8e23a9b4e216e170e1cfb22b2

Chuwei He   commited 2025-09-04 14:09:11 +09:00
b5ad6f83b2
Merge "Revert "Fix flake in ConnectivityDiagnosticsManager"" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-09-03 03:42:30 -07:00
01a9a57f0b
Revert "Fix flake in ConnectivityDiagnosticsManager"
This reverts commit 3a6edd4e01.

Reason for revert: b/436710938,test gets nc before network is validated especially if the “mobile data always on” is disabled 

Change-Id: Ie58d2a7eb707fd0baf5217004d01d3e56fad5449

Motomu Utsumi   authored and   Android (Google) Code Review   commited 2025-09-03 01:04:16 -07:00
f41a551ecd
Merge "Generate java code for VCN metrics" into main
Hnin Naing   authored and   Android (Google) Code Review   commited 2025-09-02 13:37:01 -07:00
e7e1a7a4d5
Generate java code for VCN metrics
Add genrule for VCN metrics atoms and add wrapper utility class for logging using the generated java code, which currently has func for logging safe mode and VCN network validation states.

Bug: 288600040
Flag: EXEMPT METRICS
Test: atest CtsVcnTestCases, FrameworksVcnTests
Change-Id: Ia0f42c3435752399eb3ed480bfe62ffac31ccc1e

Hnin Naing   commited 2025-09-02 19:31:50 +00:00
340990fd30
Merge "Prevent duplicate downloads in DownloadHelper" into main
Sandro Montanari   authored and   Android (Google) Code Review   commited 2025-09-01 01:41:00 -07:00
34465d06c8
Merge "BpfCoordinator: include PMTU in IPv6 BPF forwarding rule dumps." into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-08-31 23:19:16 -07:00
3159186ec8
Merge "tcpAccECN: Fix counter order in tcp option" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-08-31 02:41:09 -07:00
7cac52b55b
Merge "tcpAccECN: Fix to increment ceb counter" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-08-31 02:40:26 -07:00
87fb1bd838
Convert uses of @hide to block tag
In most places the `@hide` doctag is treated as a block tag on its own
line. However, there are a few places where it is treated as an inline
doctag, e,g. `{@hide}`, and some places where it looks like a block
tag but is inline in the text, e.g. `Some text. @hide`. Dealing with
all the types increases the complexity of Metalava and makes it
slightly slower.

This change replaces the non-block tag forms with a block tag.

Flag: EXEMPT change the form of @hide does not change the API or behavior
Bug: 429965593
Test: m checkapi
Change-Id: I4ffe44a329dbcb7f0a7bd61af16c3bd99cacdac4

Paul Duffin   commited 2025-08-29 21:19:30 +00:00
6eaa841657
Refactor Tether4Key to use Inet4Address
Change the type of src4 and dst4 from byte[] to Inet4Address in the
Tether4Key class. This simplifies the code by removing the need for
conversions between byte arrays and Inet4Address objects.

Bug: 392509494
Test: atest TetheringTests
Flag: EXEMPT refactor
Change-Id: I3072a8520c93042a25d1f60aa41bdfa5485062f6

Sarup Dalwani   commited 2025-08-29 19:30:29 +00:00
f7adba65b3
Merge changes from topic "routecontrollerchangeforislocal" into main
* changes:
  Migrate NetdUtils from networkAddRoute to networkAddRouteParcel.
  Passing isLocalRoute to netd add,remove and update route.

Sarup Dalwani   authored and   Android (Google) Code Review   commited 2025-08-29 08:01:18 -07:00
bc8c8c040e
Prevent duplicate downloads in DownloadHelper
This change modifies `DownloadHelper` to check if a URL is already
scheduled for download (in pending, running, or paused status) before
enqueuing a new request. If a download for the same URL is found, the
existing download ID is returned, avoiding redundant requests to the
`DownloadManager`.

Bug: 437217681
Test: atest NetworkSecurityUnitTests
Flag: EXEMPT BUGFIX
Change-Id: I64dd5473b4fdb23241f5e2503c65cb64db56617c

Sandro Montanari   commited 2025-08-29 01:02:47 -07:00
b7c4c84a37
tcpAccECN: Fix counter order in tcp option
Counter order in AccECN options is the following

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  Kind = 174   |  Length = 11  |          EE1B field           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| EE1B (cont'd) |           ECEB field                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  EE0B field                   |             Order 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Test: TH
Bug: 440448408
Flag: EXEMPT tcpAccECN program is not attached
Change-Id: I7d76d40f7499e44c89c8241919a0d3c416b0ce00

Motomu Utsumi   commited 2025-08-29 16:27:29 +09:00
2977062223