* changes:
[CLATJ#16] Rename JNI/Dependencies function and improve JNI error handling
[CLATJ#15] ClatCoordinator: add socket filter to packet socket
[CLATJ#14] ClatCoordinator: add anycast to raw socket
[CLATJ#13] ClatCoordinator: open raw socket
[CLATJ#12] ClatCoordinator: open packet socket with a given mark
[CLATJ#11] ClatCoordinator: config tun interface and bring up
[CLATJ#10] ClatCoordinator: detect mtu
[CLATJ#9] ClatCoordinator: open tun interface
[CLATJ#8] ClatCoordinator: select IPv6 address with checksum-neutral IID
[CLATJ#7] ClatCoordinator: select IPv4 address for clatd
[CLATJ#6] libclat: move configure_packet_socket() from netd to apex
[CLATJ#5] libclat: move detect_mtu() from netd to apex
[CLATJ#4] libclat: move selectIpv4Address() and isIpv4AddressFree() from netd to apex
[CLATJ#3] libclat: move generateIpv6Address() from netd to apex
[CLATJ#2] libclat: Add libclat_test to postsubmit
[CLATJ#1] libclat: move makeChecksumNeutral() from netd to apex
This is a clean move. The content of netd.c is not changed. The object
name is still netd.o. But the module name is renamed to netd.o_mainline
to avoid name collision in sc-mainline-prod branch.
Modified Android.bp according to the file location. The sub_dir is
newly specified. The object file will be compiled to:
- apex/com.android.tethering/etc/bpf/net_shared/netd.o
The extracted programs and maps will be in:
- sys/fs/bpf/net_shared/
The netd.o will not be loaded in pre-T because the bpfloader before T
does not load objects from paths other than:
- apex/com.android.tethering/etc/bpf/
- /system/etc/bpf/
Bug: 202086915
Test: cd system/netd; atest
Test: atest TrafficStatsTest NetworkUsageStatsTest
Change-Id: I5281c851341f9258a37d8aad6da4196c06342940
Without this, proguard strips tcFilterAddDevIngressPolice (as its unused
inside the Tethering apk) and crashes the system.
Bug: 202086915
Bug: 157552970
Test: device boots
Change-Id: I3f29a2d2371ecbfad929f8812f7f15f68258b5d1
- rename JNI functions with prefix native_*
- throw exception while JNI function gets invalid address argument
- throw exception while JNI function returns invalid address
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit
Change-Id: I6745a61525c6f72a61fbde0b21b3f7abcdf2446a
Update our packet socket filter to reflect the new 464xlat IP address
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit
Change-Id: Ic50dc122731f311ad00ab8bff5472cb3bc41f5f1
Start translating packets to the new prefix.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I38729c23fce72428919b33ac531ede9593337a0a
Move the raw socket initialization from netd to mainline because
mainline module is going to launch clatd. Need to provide raw
socket for writing local 464xlat IPv6 packets.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I6d1da4f1b400eeed87771ae8197b0c58ec50804b
Move the packet socket initialization from netd to jni because
mainline module is going to launch clatd. Need to provide packet
socket for reading local 464xlat IPv6 packets.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I1cef6e099403f883d668081fb5e917863f5a3c2a
Apply mtu and selected IPv4 address to tun interface.
Then, bring up the tun interface.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I24a2a91e2b084be28820a7a63b265c5f56293334
Detect the available mtu for clat. The native mtu detect function
is moved from netd to libclat which is called by jni. The java
adjust mtu function is moved from netd native code.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: Icf5f57c7e7b947997b76152722e46acdd9d95c1a
Open the v4-... tun interface for clat. The native function
is moved from netd to jni.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I3f3c587275125ce3fc7481006947211f17dbb2d4
Select a local 464xlat IPv6 address for clatd. The IPv6 address has
checksum-neutral IID. The native function is moved from netd to
libclat. Its test is moved from netd as well.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I11520e5c086e475999847d829dd6341b14199b39
Introduce ClatCoordinator to replace netd/ClatdController.
This is a startup commit. Starting clatd needs to prepare local
464xlat ipv4 address, local 464xlat ipv6 address, tun interface,
clat read/write sockets. These will be implemented from this
and followup commits. This commit implements that prepare local
464xlat ipv4 address.
Bug: 212345928
Test: flash and boot
Run "atest ClatCoordinatorTest" in a followup commit.
Change-Id: I486db8aef0181ee1aedd7cd7702f95d5a1cef812
configure_packet_socket() is moved from ClatdController. Only change
the failure return value from errno to -errno. The remaining parts
are the same.
The test is modified from ClatdControllerTest::ConfigureIpv6Address.
Simply set socket filter to an interface and check that the packet
socket is bound to the interface. We can't check the socket filter
because there is no way to fetch it from the kernel.
Bug: 212345928
Test: build and boot
atest libclat_test
Change-Id: Ia33c21051b040829c7d2aa55ed5b7de8766c98c5
detect_mtu() is moved from ClatdController without behavior
change. The unique_fd for socket fd is replaced by primitive int
because libbase is not supported in mainline.
Bug: 212345928
Test: build and boot
atest libclat_test
Change-Id: Ib9c1a9d4b9e1c141d88164e8489c5044fdf70685
isIpv4AddressFree() is moved from ClatdController without behavior
change.
selectIpv4Address() and its test are moved from ClatdController as well.
They have been refactored slightly for testing because function pointer
of isIpv4AddressFreeFunc is not a global variable anymore. We can't set
global function pointer to change selectIpv4Address() behavior for
testing. Instead isIpv4AddressFree is sent as an argument of function
pointer. For public caller, selectIpv4Address() has no behavior change.
For test caller, they can call an internal selectIpv4AddressInternal
(.., fn) to change isIpv4AddrFreeFn function pointer for testing.
Bug: 212345928
Test: build and boot
atest libclat_test
Change-Id: Iab5e6fd5ebbccf10e7b3be2251b45949cf3f3464
generateIpv6Address() is moved from ClatdController without behavior
change. The unique_fd for socket fd is replaced by primitive int
because libbase is not supported in mainline.
Bug: 212345928
Test: build and boot
atest libclat_test
Change-Id: I42e152e6fe3ad577a0274e1d55e737318f61176d
Introduce the library libclat to implement clat functions for jni.
It is helpful for unit test.
makeChecksumNeutral() and its test are moved from ClatdController
without behavior change.
Bug: 212345928
Test: build and boot
atest libclat_test
Change-Id: I1c0981d98141fc1cc07b2d3a0f3cbddf38683ff3
- Add a default to framework-connectivity-tiramisu for disabling
T-only build rules.
- Separate the tiramisu hidden apis from hiddenapi txt files, so
that the framework-connectivity-tiramisu file can avoid being
referenced by the APEX when the JAR is not part of it.
Bug: 206893064
Test: m
Merged-In: I37c7385b456e4d71789aafe33cc8375adf40a681
Change-Id: I37c7385b456e4d71789aafe33cc8375adf40a681
Correct the SDK for those tests are expected running in T+
device. Check @IgnoreUpTo(S) may be incorrect after receiving
patches before T release.
Refer to temporary constant definition in DevSdkIgnoreRule until
the SDK constant being pushed into AOSP and synced with branch
used for mainline.
BUg: 215294242
Test: atest CtsNetTestCases CtsNetTestCasesLatestSdk
Change-Id: Ide6a241f7944dd1e75bc33b21aa29471a5df94c6
Correct the NetworkStatsServiceTest
BatteryStatsImpl is using INetworkStatsService APIs, which
cannot be accessed after moving into the mainline module. So, replace
and remove those hidden API usages.
Bug: 210066922
Test: atest BatteryStatsImplTest WifiPowerCalculatorTest
MobileRadioPowerCalculatorTest NetworkStatsServiceTest
CTS-Coverage-Bug: 213437796
Change-Id: I47dc377a5cce7d8a0029dc808ad0f46e651764b1
This test is testing non-updatable code in frameworks/base, so it should
not live in packages/modules/Connectivity.
Test: treehugger
Change-Id: Ifdefeeca0190d27e98f687446f984dcc711a8c55
DevSdkIgnoreRule.IgnoreUpTo() will not work as expected without
the rule defined.
Bug: 184750836
Test: atest android.net.Ikev2VpnProfileTest#\
testBuildExcludeLocalRoutesSet works as expected with ignore
rule
Change-Id: I03a5b28963cd6feebe4358d57c070d941cd114e5
Add @ConnectivityModuleTest to tests for classes that are mainly used to
back the connectivity (tethering) module, in particular data classes.
This causes the test not to be run in NetworkStack/CaptivePortalLogin
MTS tests when the connectivity (tethering) module is not installed.
Skipping such tests is necessary in that configuration as they may test
behavior that is new in the latest update, and data classes backing the
connectivity module would not be affected by
NetworkStack/CaptivePortalLogin updates anyway.
Bug: 211075897
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I6163cd998fc78765b903fdb7acd21e652bc711c9
Tests in tests/common and tests/cts are run as part of CtsNetTestCases.
Many used assertFieldCountEquals in parceling/unparceling tests to
ensure that unexpected fields were not added, or that they were not
missed when testing parceling/unparceling.
However with many of the classes updatable through module updates, the
field count may change in the future, breaking CTS tests.
Stop checking for the field count, as it would break on module releases,
and its value is lower than the maintenance cost.
Bug: 205901761
Test: atest CtsNetTestCases
Change-Id: I79854741f7e834574d4825bb737ef507785310fe
This uses a similar scheme to our existing OWNERS files, which
all come from a common location in the master branch.
Test: repo upload
Change-Id: I672070302789ac38a738ab6626f47ec9cbc75dd9
The TEST_MAPPING file already contains a mainline-postsubmit
stanza, but according to go/test-mapping-mainline-user-guide
this information also needs to be in AndroidTest.xml (or in
Android.bp, for tests that are not covered by an AndroidTest.xml
and where soong autogenerates the test config).
Test: m bpf_existence_test
Change-Id: I103f5fefbfefa6fd2b59ab6c209fbf1dceada4ba
This change only apply to the device after T.
Use new bluetooth API to change bluetooth tethering settings and the
new API provide the callback to to notify Tethering when bluetooth
interface is ready. Tethering doesn't use bluetooth interface status
change event from netlink to add/remove IpServer anymore.
Tag: #feature
Bug: 190438212
Test: TetheringTest
Change-Id: Iae92d98d500f83b116da7282cf1130fb8fecf53d
Set clatd privs to clat:clat:-r-sr-sr-x and set its parent
directory privs to root:system:dr-xr-x---. Makes sure that
only root and system group members can execute the binary.
Test: flash and check the file permission
$ adb shell ls -lZ /apex/com.android.tethering/bin
dr-xr-x--- 2 root system u:object_r:system_file:s0 4096 1970-01-01 08:00 for-system
$ adb shell ls -lZ /apex/com.android.tethering/bin/for-system
-r-sr-sr-x 1 clat clat u:object_r:clatd_exec:s0 24352 1970-01-01 08:00 clatd
Bug: 212345928
Test: test clat
1. Connect to ipv6-only wifi.
2. Make IPv4 traffic.
$ ping 8.8.8.8
Change-Id: I9537d47b135e6e0324fb40ece2b9f7befb159244