Commit graph

111,295 commits

Message SHA1
clatd: disable AARCH64 specific seccomp kill filter
(while investigating observed failures)

Bug: 418375944
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1b34d172eb4fd5d631046db47c3d9be39d21b903

Maciej Żenczykowski   commited 2025-06-03 15:14:05 -07:00
2fba8b1a7a
Merge "bpf/progs/netd.c: split 5.4+ specific cgroup in/egress progs" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-03 12:32:33 -07:00
ea4d8506c5
Merge "Make EthernetPort#toString more legible" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-06-03 12:25:00 -07:00
d6541b8daa
Merge "Fix NullPointerException in waitForRouterAdvertisement" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-03 10:30:21 -07:00
04cb56f845
Merge "Add support to ctx in runProgram." into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-06-03 09:13:09 -07:00
21da8c24b4
bpf/progs/netd.c: split 5.4+ specific cgroup in/egress progs
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic58ed5117b2ea9e654597aa57c201707695d3eca

Maciej Żenczykowski   commited 2025-06-02 16:03:38 -07:00
5138000196
bpf/progs/offload.c: add comment about pmtu
Bug: 263884894
Flag: EXEMPT mainline
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I34c8d033ee0da34fc6db4d6093ed6a10c57c0dc1

Maciej Żenczykowski   commited 2025-06-02 15:47:11 -07:00
f1f59d721d
Integrate a fix to avoid calculation of socket key when the datagram does not has an ip address.
Bug:419554480

This is not used in platform code. This code path is only used when the
mDNS stack is used as a library.

Flag: EXEMPT dead code in the platform
Test: - Use a pre-S device to test.
 - Test with the updated library and integration with Cast sample to test.
Change-Id: I94d3c8a8bacf8581f44760d41afba830cdd09252

Diego Valenzuela   commited 2025-06-02 12:31:06 -07:00
b33d755683
bpf/progs/netd.c: use skb->gso_segs when possible
Use skb->gso_segs to calculate the number of segments.
This removes the need to estimate the segment count on our own.
This will improve the accuracy of the accounting.

Bug: 263884894
Flag: EXEMPT mainline
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibc7da2fcd968d6871fca32527cd8c6d694d77452

Maciej Żenczykowski   commited 2025-06-02 07:49:34 -07:00
7d82de4f3e
bpf/progs/offload.c: improve ipv6 overhead calc & pmtu checks
Bug: 263884894
Bug: 419747540
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Icbc3c0dfa1d60f9eec84e41172a2b95a687a50fd

Maciej Żenczykowski   commited 2025-06-02 07:16:22 -07:00
3035bfd296
bpf/progs/offload.c: improve ipv4 overhead calc & pmtu checks
Bug: 263884894
Bug: 419747540
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5978b487d1bd70eea0d49691244a2bc41e9ead11

Maciej Żenczykowski   commited 2025-06-02 07:15:28 -07:00
26dd775837
Merge "Skip APF multidevice CTS if device support automotive feature" into main
Jimi Chen   authored and   Android (Google) Code Review   commited 2025-06-02 05:17:20 -07:00
a17b23df03
bpf/progs/offload.c: disable ipv6 offload for non-gso >pmtu
Bug: 263884894
Bug: 419747540
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Idecc355084220ea5c53924c720c806adab153b5d

Maciej Żenczykowski   commited 2025-06-02 01:14:16 -07:00
5d79fdffd3
Merge "bpf/progs/offload.c: split ipv6 offload for 5.4+ kernels" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-02 00:52:27 -07:00
c9c16fc884
Skip APF multidevice CTS if device support automotive feature
Flag: EXEMPT mainline
Bug: 407637806
Test: TH
Change-Id: I1dff6c2507455451951314ba0298cecb62d4bb17

Jimi Chen   commited 2025-06-02 05:10:24 +00:00
80a2a14a91
Merge "Refactor: Pass parameterized argument via test constructor" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-06-01 21:09:55 -07:00
7b633c65ef
Merge "DHCPv6 addr reg: add ADDR_REG_INFORM and ADDR_REG_REPLY message types." into main
Xiao Ma   authored and   Android (Google) Code Review   commited 2025-06-01 17:23:12 -07:00
bb47bc9433
bpf/progs/offload.c: split ipv6 offload for 5.4+ kernels
(no-op prep work for gso support)

Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iff7736b0497f93a2f0df53315e5cb5b990c94eb0

Maciej Żenczykowski   commited 2025-06-01 00:49:39 -07:00
84c89b1498
Update start timestamp for querying data usage
The previous implementation used a fixed start timestamp for
querying network usage statistics, initialized based on the
device's boot time. This caused the query window to grow
indefinitely as the device uptime increased, leading to
inefficient queries that fetched and processed a large
ever-expanding amount of historical data.

This change refactors the logic to use a rolling start
timestamp. The `mStartTime` is now updated after each
usage report is generated (in `onLost`). By resetting
the start time to a more recent point (current time
minus one bucket duration), we ensure that subsequent
queries for usage snapshots are performed over a small,
manageable time window.

This optimization prevents fetching excessive data
from the NetworkStatsManager, improving the efficiency
of the metrics collector. Dependencies for time and
duration have also been abstracted for better testability.

Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.metrics.SatelliteCoarseUsageMetricsCollectorTest \
  --update-device
Flag: EXEMPT controlled with kill switch
Bug: 419123367
Change-Id: I49d3b044f0a038093060f5541ea263d2d0d253a2

Junyu Lai   commited 2025-05-31 16:37:59 +08:00
48c3c2bf10
Report satellite coarse usage
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.metrics.SatelliteCoarseUsageMetricsCollectorTest \
      --update-device
Test: atest ConnectivityCoverageTests --test-filter 'CSTest*' --update-device
Test: atest ConnectivityCoverageTests --test-filter 'ConnectivityService*' --update-device
Test: Manual:
  1. Change code to use TRANSPORT_CELLULAR
  2. m statsd_testdrive && statsd_testdrive -e 1102
  3. Turn off mobile data.
Flag: EXEMPT controlled with kill switch
Bug: 419123367
Change-Id: I264efa6802612809fdbff22901f31447f370bbe5

Junyu Lai   commited 2025-05-31 16:37:59 +08:00
bb589cf33c
Merge changes Ic9233784,I093c0bb4,I3c90bf84,I3d1f08aa into main
* changes:
  Move setInterfaceUpState out of try / catch block
  Pass EthernetPort to onNewLink / onDelLink
  Populate EthernetPort object in netlink handler
  s/isValidEthernetInterface/shouldTrackInterface/

Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-05-30 16:12:53 -07:00
f17adec833
Merge changes from topic "destroy_socket_at_cs" into main
* changes:
  Destroy sockets lacking permission at CS.
  Destroy sockets with nlmsg RTM_DELADDR
  Destroy sockets with NetworkAgent update event
  Add a Map to NetworkAgent list for IP address
  Add socket destroying methods to InetDiagMessage.

Sewook Seo   authored and   Android (Google) Code Review   commited 2025-05-30 16:00:11 -07:00
13e6742742
Make EthernetPort#toString more legible
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I6abf322a57412edf97b20d6b96ca5747938fd1ea

Patrick Rohr   commited 2025-05-30 13:30:53 -07:00
1185d242a6
Fix NullPointerException in waitForRouterAdvertisement
The failure is caused by a RA packet read race condition. The test
receives a callback that local-only tethering has started and
immediately begins listening for an RA. However, the system's RA daemon
may not have finished initializing.

The test's packet reader times out waiting for an RA and returns a null
packet. The waitForRouterAdvertisement then uses the null packet
checking for RA, causing NPE. Change modifies waitForRouterAdvertisement
to check if a packet is null before processing it.

Flag: EXEMPT bugfix
Bug: 418010532
Test: atest android.net.EthernetTetheringTest#testLocalOnlyTethering
Change-Id: Ic534c53766958ae48a82687a9bd6d09297f074f2

Chris Desir   commited 2025-05-30 12:33:34 -07:00
6fecb23808
Move setInterfaceUpState out of try / catch block
setInterfaceUpState does not need to be in the try / catch block as it
doesn't let any exceptions escape. Also move the call to after checking
whether the returned config is null. In practice, this should never
happen; but if it did, we wouldn't end up doing anything anyways, so
bringing up the interface is pointless.

This also annotates config as final and returns early out of the catch
block (because the second log statement is technically incorrect).

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Ic9233784594ead6779caf6267afad7b518a873ea

Patrick Rohr   commited 2025-05-30 11:47:22 -07:00
818f183fc4
Pass EthernetPort to onNewLink / onDelLink
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I093c0bb49c31af5722c9907eec05b33a32086bc8

Patrick Rohr   commited 2025-05-30 11:40:22 -07:00
4deae2ff49
Populate EthernetPort object in netlink handler
Figuring out whether an interface is a USB NCM interface requires
calling the ethtool API. In order to ensure the interface does not
change underneath us, it must use the ifindex rather than the interface
name.

This change starts populating EthernetPort, a tuple containing interface
name, MacAddress, and index, using the information received from
rtnetlink.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I3c90bf844304f710ebf0a629d66ebcb487e144e7

Patrick Rohr   commited 2025-05-30 11:30:00 -07:00
57331f1682
s/isValidEthernetInterface/shouldTrackInterface/
In preparation for tracking USB NCM interfaces independent of whether
they were included as part of the regex.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I3d1f08aac20d613db9e845044b11b9484ddba2ed

Patrick Rohr   commited 2025-05-30 11:30:00 -07:00
649b3ad0d3
Add alint hook to Connectivity repo
Onboarding repo to go/alint, which will run ayeaye analyzers locally.

Bug: 419241911
Test: Locally
Flag: NONE, repo change
Change-Id: I78b938222ac73f00438692045e4c062cb5356029

Doğancan Emek   commited 2025-05-30 11:36:49 +00:00
9fecf5dee1
DHCPv6 addr reg: add ADDR_REG_INFORM and ADDR_REG_REPLY message types.
Flag: EXEMPT guarded by an legacy experiment flag
Bug: 293393743
Test: TH
Change-Id: If2b30265c45e3a57c867fd7ba1df5f4245a37b35

Xiao Ma   commited 2025-05-30 16:51:55 +09:00
eb1cc9441c
Destroy sockets lacking permission at CS.
Move destroying socket logic for lacking permission to CS from netd

Bug: 373280981
Bug: 331139818
Flag: android.net.platform.flags.connectivity_service_destroy_socket
Test: atest ConnectivityCoverageTests
Test: device test

Change-Id: Id933d51d6175958a1b78443360858db577319622

Sewook Seo   commited 2025-05-29 20:15:47 -07:00
34ef7dbd1b
Destroy sockets with nlmsg RTM_DELADDR
Destroy sockets that matched to netId less than MIN_NET_ID for the non
link local address in RTM_DELADDR.
Destroy sockets on link local address with the corresponding interface
ID.

Bug: 373280981
Bug: 331139818
Flag: android.net.platform.flags.connectivity_service_destroy_socket
Test: atest ConnectivityCoverageTests
Test: device test
Change-Id: I4d8127fc693f8b32f815c5cddbae0b64deeb23e5

Sewook Seo   commited 2025-05-29 20:14:13 -07:00
fe1f5cbf32
Destroy sockets with NetworkAgent update event
Destroy platform managed sockets on the removed IP address based on NetworkAgent update.

Bug: 373280981
Bug: 331139818
Flag: android.net.platform.flags.connectivity_service_destroy_socket
Test: atest ConnectivityCoverageTests
Test: device test
Change-Id: I6a1d2d0c25c130c2747d66bee203b0408e2fa0da

Sewook Seo   commited 2025-05-30 03:10:38 +00:00
1af98cb493
Merge "Change RequestTracker log tag to TetheringRequestTracker" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-29 19:02:15 -07:00
9e06f4d2c4
Change RequestTracker log tag to TetheringRequestTracker
So related logs show up when grep'ing for tethering.

Test: TH
Bug: 10000001
Flag: EXEMPT trivial
Change-Id: I86791be62a068a8a64eca35fd5ce01ecde750a04

Patrick Rohr   commited 2025-05-29 11:12:14 -07:00
e4db9c7316
bpf/progs/offload.c: disable ipv4 offload for non-gso >pmtu
Bug: 263884894
Bug: 419747540
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I937bd3e40ba0b8c2e1297e25582cd074d89ebb48

Maciej Żenczykowski   commited 2025-05-29 09:15:15 -07:00
954bc98a22
Add support to ctx in runProgram.
Programs of type raw_tp need the input to be passed in the ctx
instead of the data.

Test: with ag/33648187
Change-Id: I79ac0126d91c9eafd847a0c8709a47a0113a9430

Alessio Cosenza   commited 2025-05-29 16:10:22 +00:00
69a9bbcee0
bpf/progs/offload.c: split 4.14/4.19/5.4 into 4.14/4.19 & 5.4
Prep work to allow 5.4+ specific implementation.

Bug: 419747540
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8aa40b3e2c068e39b34bff3d8c58cc8feccbf139

Maciej Żenczykowski   commited 2025-05-29 08:50:50 -07:00
bda15bd5c1
bpf/progs/offload.c: fix kver of full implementations
The full implementations are targeted for 5.10 kernels (S+), not 5.8.
Let's update the names to reflect that.

Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2694c55183e5634dec9d752286728b4070178440

Maciej Żenczykowski   commited 2025-05-29 08:06:45 -07:00
1f830cd497
Merge "BpfSyscallWrappers.h: fix to pass 'attr' by address instead of by const reference" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-05-29 04:37:27 -07:00
a3b8091626
Merge "NetBpfLoad: Add errno to log for map verification failures" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-05-29 03:57:50 -07:00
83566c1857
BpfSyscallWrappers.h: fix to pass 'attr' by address instead of by const reference
(shot in the dark)

checking attr.info.info_len in line 265 could probably be optimized out if we pass by const reference, since one could assume it is still sizeof(info).

Bug: 414570528
Flag: EXEMPT mainline
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1e5ba472042ecce0260f2e3b60a0a88095734f8d

Maciej Żenczykowski   commited 2025-05-29 02:43:55 -07:00
f53f0f0e21
Merge "Clean up eventuallyExpectLost" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-05-29 01:34:58 -07:00
d84de68e38
NetBpfLoad: Add errno to log for map verification failures
We sometimes see issues when trying to load BPF maps, it's helpful to know
what errno was set.

Bug: 414570528
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8b78ee17ebad076d073d50bfd0f01440fe7187a2

Maciej Żenczykowski   commited 2025-05-29 01:25:26 -07:00
4b3937b7f3
Merge "Support checking transport types in NetworkTemplate" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-28 22:38:11 -07:00
7c9babc63b
Clean up eventuallyExpectLost
Not needed anymore.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I16266685530171ece9cac0dc911c88639b5481bf

Patrick Rohr   commited 2025-05-28 15:28:37 -07:00
fbbb9def0f
Merge "Clean eventuallyExpect invocations" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-05-28 15:09:28 -07:00
3bdd67a669
Fix flake in EthernetManagerTest
Depending on how the DAD timers align, there could be 1 or 2
onLinkPropertiesChanged callbacks. Furthermore, depending on how the
dice fall, NO_CALLBACK_TIMEOUT is too short (500ms) to account for this.

This CL changes the expectation from expect<Lost> to
eventuallyExpect<Lost> to skip over any onLinkPropertiesChanged
callbacks that might have been received.

Test: atest EthernetManagerTest#testUpdateConfiguration_forAllowedUids
Flag: EXEMPT mainline
Bug: 420648099
Change-Id: Ifa853accdfca2c00de4d7211badc75ae057d948f

Patrick Rohr   commited 2025-05-28 13:08:24 -07:00
f1e3848b33
Merge "Refactor: apply pyformat for coding style consistency" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-28 07:26:50 -07:00
0d0d3a6534
Merge "Add notice of requesting source code in tethering" into main
Manish Singh   authored and   Android (Google) Code Review   commited 2025-05-28 06:40:11 -07:00
3ea6a7ca9f