Commit graph android_packages_modules_Co.../Tethering
Message SHA1
Tethering: allow ipv6 1500 mtu again
but still fallback to 1400 if we don't know any better

Bug: 432676104
Test: TreeHugger, mm in p/m/C
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7e1d70e73d2fd24d1f79dc40f3b18a6d82d235ef

Maciej Żenczykowski   commited 2025-08-14 09:37:48 -07:00
39de84ab4c
Merge "Tethering: pass the mtu we announce via RA into updateIpv6UpstreamInterface()" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-08-14 03:56:49 -07:00
db6b206a16
Tethering: pass the mtu we announce via RA into updateIpv6UpstreamInterface()
Bug: 432676104
Test: TreeHugger, mm in p/m/C
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie6d9d351be178085fa3d07947f1269058e18e376

Maciej Żenczykowski   commited 2025-08-13 23:43:00 -07:00
e92c190c38
Merge "Tethering: pass pmtu into updateIpv6UpstreamInterface()" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-08-13 00:35:13 -07:00
9fdb003b6f
Merge changes I7cc9c612,I04e91260 into main
* changes:
  Tethering: pass pmtu into updateAllIpv6Rules()
  Tethering: pass pmtu into Ipv6UpstreamRule()

Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-08-12 21:18:12 -07:00
8570899fff
Merge "Tethering: consider route MTUs when calculating IPv6 RA MTU." into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-08-12 21:07:21 -07:00
d32dafb06f
Tethering: pass pmtu into updateIpv6UpstreamInterface()
Bug: 432676104
Test: TreeHugger, mm in p/m/C
Flag: EXEMPT mainline/noop
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie8f12d010798e8066b25334f9a12c333c50331bc

Maciej Żenczykowski   commited 2025-08-12 19:54:50 -07:00
af574432b7
Tethering: pass pmtu into updateAllIpv6Rules()
Bug: 432676104
Test: TreeHugger, mm in p/m/C
Flag: EXEMPT mainline/noop
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7cc9c612434c269cf2d13462f784d1f7e92d5219

Maciej Żenczykowski   commited 2025-08-12 19:54:50 -07:00
4451a61097
Tethering: pass pmtu into Ipv6UpstreamRule()
Bug: 432676104
Test: TreeHugger, mm in p/m/C
Flag: EXEMPT mainline/noop
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I04e912604110f7b80ae31468b4f0a8938d127290

Maciej Żenczykowski   commited 2025-08-12 19:54:50 -07:00
897600d37b
BpfBitmap: some minor optimizations
Test: TreeHugger, atest BpfBitmapTest
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5acf5bcb31777e503e58cef733d617a53006d2b9

Maciej Żenczykowski   commited 2025-08-12 16:02:23 -07:00
d2d26c661a
Tethering: consider route MTUs when calculating IPv6 RA MTU.
The IPv6 Router Advertisement (RA) MTU is now derived from
the minimum of the interface MTU and the MTUs of all IPv6 routes
on the upstream interface, before being clamped to the 1280-1400 range.

This ensures the advertised MTU respects any smaller
MTUs specified by individual routes.

Bug: 432676104
Test: Treehugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If371825bd8f773ae23d1122211caa42ebf5c1f2a

Maciej Żenczykowski   commited 2025-08-12 14:06:05 -07:00
a697b2b8c8
replace CookieTagMapKey with S64
(mostly autogenerated, with minor tweaks to make it build)

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

Maciej Żenczykowski   commited 2025-08-07 15:52:35 -07:00
9ef3916ba4
replace TetherLimitValue with S64
(mostly autogenerated, with minor tweaks to make it build)

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

Maciej Żenczykowski   commited 2025-08-07 15:51:40 -07:00
84ac5ae4e7
replace TetherStatsKey with S32
(mostly autogenerated, with minor tweaks to make it build)

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

Maciej Żenczykowski   commited 2025-08-07 15:48:28 -07:00
b5f97280d6
replace TetherLimitKey with S32
(mostly autogenerated, with minor tweaks to make it build)

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

Maciej Żenczykowski   commited 2025-08-05 19:15:35 -07:00
31c8c5b10a
replace TetherDevValue with S32
(mostly autogenerated, with minor tweaks to make it build)

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

Maciej Żenczykowski   commited 2025-08-05 19:15:35 -07:00
4e3adbd553
replace TetherDevKey with S32
(mostly autogenerated, with minor tweaks to make it build)

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

Maciej Żenczykowski   commited 2025-08-05 19:15:35 -07:00
a3f6c5718d
Lower tethering IPv6 MTU to 1400 (to match newly clamped RA)
Bug: 432676104
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3674036bf28454bc57dcfeead9ff5f2917046939

Maciej Żenczykowski   commited 2025-08-01 16:34:16 -07:00
18fe2434db
Merge "Clamp the advertised IPv6 MTU to 1280-1400" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-08-01 14:05:36 -07:00
53eef4fe97
Clamp the advertised IPv6 MTU to 1280-1400
RaParams is populated with the upstream IPv4 MTU, rather than the IPv6
or route MTU. This change clamps that value between 1280 and 1400. 1280
as it is the minimum IPv6 MTU and 1400 to keep QUIC working. A follow up
change could improve on this by either adding the IPv6 MTU to
LinkProperties, or (possibly better) binding and connecting a UDP socket
to determine the MTU. Note that at that point the MTU in the Tether6Key
should also be fixed.

Test: TH
Flag: EXEMPT low risk
Bug: 432676104
Change-Id: I1d900039caf84c58cd04fdb52bdeaf2d1b846268

Patrick Rohr   commited 2025-08-01 12:48:46 -07:00
bd3d103436
Delete unused cc_library_shared
Test: TH
Flag: EXEMPT mainline
Change-Id: I1409e8edbe1d6b2d55341daf394fc5c7386ed3d6

Patrick Rohr   commited 2025-08-01 11:32:53 -07:00
53e9e75a1a
Merge "Create CommonConnectivityJni to share between modules" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-07-24 09:56:39 -07:00
0e5defc1e9
Create CommonConnectivityJni to share between modules
Flag: EXEMPT mainline
Test: TH
Change-Id: Ia85dfd3d979803baca9e971d1083f54dff46de53

Jimi Chen   commited 2025-07-23 05:47:12 +00:00
e5a4e6b0ba
Don't perform entitlement checks on invalid subscription IDs
Bug: 414252282
Test: TH
Flag: EXEMPT bugfix
Change-Id: I9bd208cf9e59bcfad03108c85dd7bfeb10aeff56

Chalard Jean   authored and   Yuyang Huang   commited 2025-07-22 12:27:16 +09:00
bf34d61b8d
Merge "Prepare to move VCN: Add visibilities for tests" into main
Yan Yan   authored and   Android (Google) Code Review   commited 2025-07-15 13:09:27 -07:00
a5b6808587
Pass bluetoothUseRandomAddress via RoutingCoordinator constructor
This refactoring changes how the bluetoothUseRandomAddress flag is
accessed.

PrivateAddressCoordinator is in a library used by multiple mainline
modules(Tethering, NetworkStack, CaptivePortal, WiFi) and cannot
directly read a Tethering mainline beta flag.

To fix this, the flag's value is now passed down through constructors.

An alternative solution would be to split the Java library for each module,
but with this solution, a single utility class cannot be shared.

This commit is a no-op as the passed value is hardcoded to false.

Test: TH
Flag: EXEMPT refactor
Bug: 287177081
Change-Id: I5f2174ee94b55e7a7298b9742221d6e6c3c5cac5

Motomu Utsumi   commited 2025-07-15 11:20:01 +09:00
323d22a497
Prepare to move VCN: Add visibilities for tests
Before moving VCN code, add the new code locations to the
"visibility" fields of Connectivity dependencies.

Bug: 379938062
Flag: EXEMPT; visibility changes
Test: presubmit
Change-Id: I51becaacb93d5e43b8b8234b80cb9b272181ad01

Yan Yan   commited 2025-07-10 20:47:00 +00:00
e82942e7c5
Optionally remove legacy bluetooth tethering address cache on T+
After T, Bluetooth tethering could use a random address. But if we keep
putting the legacy Bluetooth address in the cache, the coordinator will
always assign the legacy address first until it runs into a conflict.

This change in itself does not do anything. Once we have a
trunk-stable namespace for mainline beta, we will add a flag for
this change, and check the flag in PrivateAddressCoordinator.

Bug: 287177081
Test: new unit tests
Flag: EXEMPT no behaviour changes
Change-Id: I56810b5b0e1098a5f89cbb1ad665d2b8652e860c

Yuyang Huang   authored and   Lorenzo Colitti   commited 2025-06-26 15:14:47 +09:00
acd7366b65
Minor cleanups in PrivateAddressCoordinatorTest.
Flag: EXEMPT refactor
Test: covered by existing tests.
Change-Id: If237516472a817201286621d00b9134247c85bdd

Lorenzo Colitti   commited 2025-06-26 13:26:41 +09:00
76b2419b0b
Merge "Add end to end mainline beta test flag in connectivity module" into main
Dennis Shen   authored and   Android (Google) Code Review   commited 2025-06-12 06:39:28 -07:00
3ef53cc9ff
Add end to end mainline beta test flag in connectivity module
These are dummy no op test flags meant for testing mainline beta
flagging and workflow infras. Will remove them once the test has
completed.

Bug: b/406508072
Test: m and verify in AVD
Flag: EXEMPT build system changes
Change-Id: I3d9326bce2ca0b7b8a61405a88565a1a7674c4db

Dennis Shen   commited 2025-06-11 16:14:34 -07:00
ca4ad86d20
Merge "Increase WAIT_RA_TIMEOUT_MS" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-06-04 16:17:57 -07:00
4b799ef007
Merge "Remove pending BT request when service disconnects" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-06-04 13:41:49 -07:00
dacf22f4c2
Increase WAIT_RA_TIMEOUT_MS
EthernetTethering tests on auto devices are flaky waiting for RA. Increased timeout will give a more generous window to receive RA.

Flag: EXEMPT bugfix
Bug: 418010532
Test: atest android.net.EthernetTetheringTest#testLocalOnlyTethering --iterations 50
Test: atest android.net.EthernetTetheringTest --iterations 20
Change-Id: I6092ee805267a6d50fa2842d3131eeae544c3443

Chris Desir   commited 2025-06-04 10:39:15 -07:00
f3245684d5
Remove pending BT request when service disconnects
If the PAN service disconnects before the BT iface is available, the BT
TetheringRequest will be stuck pending and prevent any new BT
startTethering attempts. This may happen if the user turns BT tethering
on and turns off BT without connecting to any device.

Fix this by always removing the pending BT request when the PAN service
disconnects.

Flag: EXEMPT minor bugfix

Bug: 420412916
Test: atest TetheringTest, manually verify turning BT tethering on,
turning off BT, and turning BT tethering on again.

Change-Id: I6bc96d6e4016d83af6cfd8e549d474ce651a44fc

Quang Anh Luong   commited 2025-06-04 09:46:51 +09:00
1a2b238bc1
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
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
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
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
Add notice of requesting source code in tethering
Flag: EXEMPT license change for b/418865751
Bug: 418865751
Test: presubmits
Test: lunch husky-trunk_staging-eng && m, an extra line is added at the top of NOTICE.html file in NOTICE.html.gz
Change-Id: I52a5bb713e4084ca7e07da8e95dc0f37477b60d9

Manish Singh   commited 2025-05-23 15:45:35 +00:00
29fce555ad
Merge "Remove RecorderCallback." into main
Jean Chalard   authored and   Android (Google) Code Review   commited 2025-05-19 19:23:31 -07:00
0d0fc56209
Merge "Tethering: use the correct socket size for conntrack dump" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-19 12:31:19 -07:00
f30ea2c8e2
Tethering: use the correct socket size for conntrack dump
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 Żenczykowski   commited 2025-05-19 10:49:35 -07:00
7a82293238
Log terrible error when tethering type mismatches
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

Patrick Rohr   commited 2025-05-19 10:04:14 -07:00
30c36198c5
Remove RecorderCallback.
This class doesn't actually serve a purpose, it only makes
TestableNetworkCallbck more complex.

Test: CtsNetTestCases ConnectivityCoverageTests
Flag: EXEMPT test-only
Change-Id: I39a598b82a3215384bdfe04980f4b280ab2c2716

Chalard Jean   commited 2025-05-19 16:35:53 +09:00
f2994122c1
Merge changes I380d649c,I64734ee7,Ie6f3859e into main
* 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 Rohr   authored and   Android (Google) Code Review   commited 2025-05-16 02:15:46 -07:00
ceb9f3e819
Remove ensureIpServerStartedLegacy.
Fold the method into its only caller. This is a no-op change.

The only types that could previously make it to this method are
BLUETOOTH pre-T and WIGIG pre-S. Therefore the call to
checkTetherableType is mostly redundant, except for the check
that WIGIG should not be brought up if the device does not
have FEATURE_WIFI. Put that check into the caller as well.

Bug: 408087033
Flag: EXEMPT refactor
Test: no-op covered by existing tests
Change-Id: I380d649c2fd8af8b00a55a5bb7d2254c8b126a34

Lorenzo Colitti   commited 2025-05-16 15:06:36 +09:00
71c1813827
Never create IpServers based on interface up for WIFI and WIFI_P2P.
This is not necessary because creating the IpServer based on
interface events is only necessary for the tether() API, and
field metrics indicate that that API is unused for WIFI and
WIFI_P2P.

Also add comments to clarify when the legacy codepath is taken.

Bug: 408087033
Test: updated unit tests
Flag: EXEMPT refactor
Change-Id: I64734ee710e9782903d4422efb0370d6fec77dd7

Lorenzo Colitti   commited 2025-05-16 15:06:36 +09:00
981a4f35c5
Rename the methods in the legacy codepath for clarity.
This is a no-op change.

ensureIpServerStartedForInterface -> ensureIpServerStartedLegacy
ensureIpServerStartedForType -> ensureIpServerStarted

Also pass in the type to ensureIpServerStartedLegacy. There's
no point reading calling ifaceNameToType again, the only thing
this can possibly do is get a new type that disagrees with the
previous one.

Bug: 408087033
Flag: EXEMPT refactor
Test: no-op covered by existing tests
Change-Id: Ie6f3859eab46a085c0d332b5de12473180032102

Lorenzo Colitti   commited 2025-05-16 13:22:06 +09:00
18a0131a4c
Remove deprecated SC_V2 constant
Test: TH
Flag: EXEMPT test-only
Change-Id: I3444fad305f49294ed8c3a850b631f385678c117

Chalard Jean   commited 2025-05-15 09:03:59 +09:00
9373e3442e