The flag allows overriding the value of config_tether_upstream_automatic
on released R devices, as issues have been found on devices where an
overlay was used to set it to false.
The flag is only usable on R devices, as S devices can either not set
the setting to false, or fix the underlying issues.
Bug: 173068192
Test: atest TetheringCoverageTests
Change-Id: Id99638916e08e596fab21cedd7bfe39906ce2fe5
This CL adds the counters collected by the tethering programs to
the output of "dumpsys tethering bpf". The counter names are
fetched by JNI code at startup and then read by the debugging
code on demand.
Example from my device:
Forwarding errors:
TCP_CONTROL_PACKET: 67
NON_GLOBAL_SRC: 13
NON_GLOBAL_DST: 17
LOCAL_SRC_DST: 7
Test: manual (debug-only code)
Change-Id: I7ec7992612556a4bca5f1b6bb52c655d6d870201
Add NetdStaticLibTestsLib into Tethering MTS , so that the tests
under client-libs can also be run when running tethering MTS.
Bug: 170598012
Test: atest TetheringCoverageTests
Change-Id: Idd47becaa4254ab80b74ad5f3ddcdd4b017a5e69
- Add methods to start and stop IPv6 forwarding upstream
- Populate the upstream IPv6 map when the first rule for any
upstream/downstream pair is created.
- Clear the upstream IPv6 map when the last rule for any
upstream/downstream pair is deleted.
Test: Added coverage to IpServerTest and BpfCoordinatorTest
Change-Id: Ib041081e95f5f449489ab63138de034222ffac8f
The two value types are identical so there is no need to have
separate classes for them.
Test: atest TetheringTests
Change-Id: Ia622b082d0a44373d21f51222f5e675e5bde08e0
Access the IPv4 downstream and upstream BPF map with the built rules.
Test: atest TetheringCoverageTests
Change-Id: I8cd6e49b377c72250988019eea57f93cccd78309
A preparation for starting monitoring conntrack event which is required
by IPv4 tethering offload.
Test: atest TetheringCoverageTests
Change-Id: Ied46aeca193554f52a90889dfdf92827e94845d6
* changes:
[NFCT.TETHER.6] Migrate tetherOffloadGetAndClearStats from netd to mainline
[NFCT.TETHER.5] Migrate tetherOffloadSetInterfaceQuota from netd to mainline
This allows for better separation of test vs production code:
we will add more test maps and programs here later.
Test: builds
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7b22e3e148ebf43fdf43dc68d0dea354f7627688
1. Correct the API annotation.
2. The entry deletion failure causes the exception in cleanTestMap().
3. Use AtomicInteger to be the counter in the lambda.
Test: atest BpfMapTest
Change-Id: I4a56038881a38bda993ef5303b71f0e2a99f03d1
BT tethering is the only user of #tether and #untether API.
Enable BT tethering may fail by race between interface status change
and #tether call. In starting BT tethering flow, tethering may receive
pan interface DOWN and UP then PanService call #tether to request for
processing its pan interface. Tethering put interface status change
event into handler queue but it process #tether and #unether calls
right away without order them by queue. It makes tethering handle
binder call #tether before pan interface DOWN even DOWN event arrived
eailer. This cause BT tethering bring down by interface DOWN event
unexpectedly. Although this still can't fix all the race cases of
tethering, but at lesat this could fix the race mentioned above.
Bug: 173310882
Test: manual ON/OFF bt tethering
atest TetheringTests
Change-Id: I2411378aa36ad4371cca12423bb65542cb8df7a1
mForwardedDownstreams is the set of downstreams who wanted upstream.
In other word, it don't contains localOnly tethering(e.g. local only
hotspot, wifi p2p tethering). Changing the list from mForwardedDownstreams
to mNotifyList make both tethered and localOnly tethering have connected
clients callback.
Bug: 172290164
Test: atest TetheringTests
Change-Id: I58fdb28efc616b00d63a1c237ea93aee4d8f2dcd
When user restriction turns on, all tethering functions should
be disabled. But tethering functions still work after
restrication is on. Because tethering request would be removed
from mActiveTetheringRequests after starting tethering that
will result in Tethering#isTetheringActive() always returns
false. Thus, update the design to check tethered interface to
ensure that any of tethering function is working.
Bug: 169596583
Test: atest TetheringTests
Test: Manually test that tethering function would be disabled
and notification would show to user after restriction
was on.
Change-Id: Icb9649a5ecdec2d029ac763b5b9b80042ad50eb9
Tethering unit test would verify the interfaction between DadProxy and
IpServer. Since DadProxy only available in S+, the test would fail if it
build with R sdk.
Bug: 171936270
Test: atest TetheringTests in both R and S
Change-Id: Ia73d4aa59d01400d1ccfd3fdc1b721e269cae952
Also add MtsTetheringTest which only run if tethering mainline
module is installed.
Bug: 166057846
Bug: 170265597
Test: atest TetheringTests
Change-Id: I434dda81eb5fab700d873a8ff3429b4222f0c7e6
The downstream do not be tracked if PrivateAddressCoordinator just
return cached address. Then, PrivateAddressCoordinator would not notify
that downstream if conflict happen.
Also remove the null check in getDownstreamPrefix because:
- An IpServer is only added to mDownstreams by requestDownstreamAddress.
- That method will only add the IpServer to mDownstreams if it has an
IPv4 address.
- As soon as that method returns, the IpServer sets mIpv4Address to the
address that was returned.
- When an IpServer is torn down, mIpv4Address is set to null after
releaseDownstream is called.
So it should never be possible for this to return null.
Bug: 168169687
Test: atest CtsTetheringTest
atest TetheringTests
Change-Id: Ide5206b013acdc499344e1c839a830c5b245af41
This test catch the regression introduced in r.android.com/1432958.
Bug: 1432958
Test: atest TetheringTest
Change-Id: Id0c1afb5563954ffee1f598a3a5de6a245d77a0e
Currently tethering only pick prefix from 192.168.0.0/16. There is no
aviable tethering address if the upstream address is 192.168.x.y/16.
This change allow tethering to pick prefix from any private address
rnages. Now it still pick from 192.168.0.0/16 only to avoid behavior
change. Will have follow up commit to change the configuration.
Bug: 166057846
Bug: 170265597
Test: atest TetheringTests
atest CtsTetheringTest
Change-Id: Ib6304eb8b4788e9196d0af48e72f00a6bda73a5f
The test had TODOs to address to use IpUtils and NetworkStackConstants
classes once they were moved to frameworks/libs/net. This is now done,
so using the new classes.
Bug: 158042941
Test: atest TetheringPrivilegedTests
Change-Id: I536b4506dbc3b42547ba9cb4e7c3c7a3e9459dd1