When the packet is too large to be sent it may cause the socket to throw
an error. This commit truncates the additional records in this case.
Bug: 407609792
Test: CI
Flag: EXEMPT bugfix
Change-Id: I77a979d7f8799f05cbcb14857061a18aecfef657
setEthernetEnabled() is used as a synchronization mechanism, so don't
let it affect enabled state.
Test: TH
Flag: EXEMPT test
Bug: 10000001
Change-Id: Ib023b7f944a8a84435dcc546aced9b0eab96d364
R & V+ never needed this as there is no platform
loading of mainline bpf.
On T/U we've been loading via mainline NetBpfLoad
for the past year, so the struct sizes only actually
matter for S.
S switches to mainline NetBpfLoad in M-2025-05
(currently in small canary), at which point the
struct sizes stop mattering.
In M-2025-07 S/T/U still look at the 'min bpf loader'
section of the .o, but don't go any deeper.
In M-2025-08 we no longer ship any bpf .o
files that need to be parsed by platform
bpfloader (as they're in a different subdirectory
in the tethering apex they don't even look in).
Test: TreeHugger
Flag: EXEMPT test deletion
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I72b9ebcf4ea59e61cdfd8bb009ede13670e3421f
Maciej Żenczykowskicommited 2025-05-22 02:08:43 -07:00
This commit adjusts the APF enforcement logic to align with 25Q2 GMS-VSR
and GTVS requirements. APFv6 is currently applicable only to handheld
and tablet devices (GMS-VSR) and TV devices (GTVS). For Wear OS devices,
APF enforcement will commence with Wear OS 7; therefore, the APF
enforcement check is skipped for devices launched/upgraded on Wear OS in 25Q2.
Bug: 381819368
Test: TH
Flag: EXEMPT bugfix
Change-Id: I4224738d9658fb4f6b67e491e7cd7d78e9b48748
Changes:
- Use setIncludeOtherUidNetworks(true) to match networks created via WifiNetworkSpecifier (local only hotsposts for other networks - Android Auto Projected).
- Fallback to ConnectivityManager::getAllNetworks and ConnectivityManager::getLinkProperties
- If S is not supported in the same way, to catch networks created with WifiNetworkSpecifier by another application.
- Subscribe to WiFiManager::NETWORK_STATE_CHANGED_ACTION event when not using setIncludeOtherUidNetworks to make sure
that network changes are being noticed even when the ConnectivityManager::NetworkCallback is not enough.
This is not used in platform code. This code path is only used when the
mDNS stack is used as a library.
Bug: 419329782
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: I82c4cd1923a3fb77468ed0cd609996bcce3d09bc
Diego Valenzuelacommited 2025-05-21 17:54:35 -07:00
requestTetheredInterface() only returns a callback if an interface for
tethering is available. The previous code timed out after 500ms which
was not enough for some devices. Instead of increasing the timeout, this
change calls setEthernetEnabled() which triggers a callback as soon as
it was processed on the handler thread. Since this event is guaranteed
to be processed after requestTetheredInterface(), the subsequent
expectOnAvailable() does not have to wait at all.
Test: TH
Flag: EXEMPT test
Bug: 418151132
Change-Id: Iff119a8e425d4071bf63fe92815061c7eb36848a
This reverts commit 7b7cfa45a6.
Reason for revert: prevents crash with no carrierConfigManager support
Test: atest ConnectivityCoverageTests
Change-Id: I9e91d2d25d16c0c2a39388f08a49bef7b17fda42
`ignore_on_*` directives haven't been used in a while and require a special version of bpfloader. Remove them.
While doing so, pad the `map_def` and `prog_def` structs, to maintain existing size.
Note: The mainline shipped bpf .o files are now in a location
that no platform bpfloader ever looked/looks at.
As such maintaining .o format compatibility with older release
is not needed.
Test: TreeHugger
Flag: EXEMPT dead code removal / mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I485c9645bdece2ad27add08347688d0f1c93e5d2
Maciej Żenczykowskicommited 2025-05-20 15:02:15 -07:00
This reverts commit b936f0c5fd.
Reason for revert: Droidmonitor created revert due to b/418898788. Will be verifying through ABTD before submission.
Fix: 418898788
Change-Id: Ia47f0cc9a33ed33f9d53064878992081a792f1ad
should be unused
Test: TreeHugger
Flag: EXEMPT dead code
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ice72d940dd3492d2b9e14dd32390a49f87bd54d1
Maciej Żenczykowskicommited 2025-05-20 08:45:15 -07:00
This is to identify if it actually happens.
It is expected not to happen, because we now pin every map and are run only once on boot.
Test: TreeHugger
Flag: EXEMPT dead code
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie46ace40f20fb4b061a91cd53f8256caebdfa71f
Maciej Żenczykowskicommited 2025-05-20 06:41:18 -07:00
This code should be dead. Abort to see whether it is.
Test: TreeHugger
Flag: EXEMPT dead code
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib5309ff683339e70bc44e135578ede75548b022d
Maciej Żenczykowskicommited 2025-05-20 06:38:57 -07:00
Offload HAL conntrack sockets are used for conntrack state dumps,
so should use the dump socket buffer size.
Bug: 409212357
Test: TreeHugger
Flag: EXEMPT mainline/trivial
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I73b4bb706efe55505b3646df63330de521a6df3f
Maciej Żenczykowskicommited 2025-05-19 10:49:35 -07:00
Today on R and S, it is theoretically possible for WiFi to start
tethering with interface name wlan0, but the tethering regexes to map
wlan0 to type TETHERING_USB, because ifaceNameToType(wlan0) could return
TETHERING_USB and the subsequent call to checkTetherableType() returns
true.
This change adds a telemetry express log to figure out whether this
actually happens in the field.
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I59d6665670fc3210ddf8d49dc28917f000751ccd
Currently, the CarrierConfigManager is null on several non-phone
projects, e.g. tv, wear devices. This is because CarrierConfigManager
is not supported on these devices.
This change checks whether it is null and improve error handling.
Flag: android.net.platform.flags.avoid_bad_wifi_from_carrier_config
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.MultinetworkPolicyTrackerTest \
--update-device
Fix: 416654774
Change-Id: I40fa7139a349472b1d5cbd36b5bff286309aebc5
PermissionMonitor#startMonitoring() was renamed to initialize().
Update comments and local variables accordingly.
Flag: EXEMPT refactor
Test: TH
Bug: 410731080
Change-Id: I840b5172e1ebc761cade0e6082fec0cab7fe9a3b
This class doesn't actually serve a purpose, it only makes
TestableNetworkCallbck more complex.
Test: CtsNetTestCases ConnectivityCoverageTests
Flag: EXEMPT test-only
Change-Id: I39a598b82a3215384bdfe04980f4b280ab2c2716
This is to provide for QPRs and the upcoming future.
Test: TreeHugger
Flag: EXEMPT mainline/no-op
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia68b5f14ff686ec06155caf022148f6e139bbb5e
Maciej Żenczykowskicommited 2025-05-18 01:45:49 -07:00
This is basically a no-op as 32-bit netd already fails on android-mainline @ 6.13 (we're now at 6.14, 6.15 is coming in a few weeks).
I know this because we had to fix ACK 6.12, and didn't port it forward.
Note: AFAIK TV is planning to release on 25Q2 and then 27Q2,
so this 26Q2+ doesn't actually affect them till a year later in 27Q2.
Modern arm cores are dropping 32-bit cpu instruction decode support.
This already happened on Pixel 8+ (Tensor G3+) and is soon coming
to the GCE cloud machines underpinning our cuttlefish VMs
(this is very much an industry wide trend for modern aarch64 cores,
I believe all new application cores since 2023 have been 64-bit only).
Pixel 6a is AFAIK the last pixel with 32-bit application support,
and that is reaching EOL approximately in July 2027.
(while most test coverage is on Pixel 6/6pro which EOLs in Oct 2026)
Note though that this isn't a great example: AFAIK all Pixels
have had 64-bit system userspace (which is what we care about here)
The transition happened in the final Nexus, the year before Pixel 1.
This means we're going to start losing *any* remaining vestiges
of test coverage that we still (might) have.
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie8a5a5dafd2f0e20ef4651c3a69957fde374ae4b
Maciej Żenczykowskicommited 2025-05-17 06:00:03 -07:00
All mainline networking programs are critical by default.
It is still parsed by the platform and uprobestats bpf loaders,
but not by NetBpfLoad, where criticality is simply hardcoded.
You can cs/ for
["]critical["] file:bpf
in android and it'll find the relevant:
ret = readSectionByName("critical", elfFile, critical);
lines.
Test: TreeHugger
Flag: EXEMPT dead code removal
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I983d0072168a89d81aa9a1e79a1e6f94bf8e822b
Maciej Żenczykowskicommited 2025-05-17 03:15:02 -07:00
We can always trivially add it back if we ever manage
to make XDP work, but that will likely be on at least 6.1+
as that's the minimum kernel version on Pixel 6+ now.
In the mean time, we can just delete it, and very
slightly speed up boot time (less things to verify).
Note: code search in android for
xdp_tether -file:kernel_logs/
xdp/tether -file:kernel_logs/
doesn't find any hits outside this one file.
Test: TreeHugger
Flag: EXEMPT dead code removal
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I39c040d79b4f175cafc141e8f0c9e631e372ebd2
Maciej Żenczykowskicommited 2025-05-17 02:53:25 -07:00
* changes:
Remove ensureIpServerStartedLegacy.
Never create IpServers based on interface up for WIFI and WIFI_P2P.
Rename the methods in the legacy codepath for clarity.
Patrick Rohrauthored and Android (Google) Code Reviewcommited 2025-05-16 02:15:46 -07:00