Commit Graph

2022 Commits

Author SHA1 Message Date
markchien
36575b46b5 Move runDhcp to TetheringTester am: f320c21120 am: 97ac1a93fa am: ef9eb6af99 am: becdc2a64d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1817921

Change-Id: Ib8d2bce7e49b5ee317ffff73e05aeb3fc4e6de53
2021-09-30 15:47:47 +00:00
markchien
97ac1a93fa Move runDhcp to TetheringTester am: f320c21120
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1817921

Change-Id: I74d5c4a6c88fb26e35218f05ef468fa125a340d4
2021-09-30 15:00:11 +00:00
markchien
139088f923 Rename mTapPacketReader to mDowntreamReader am: 0bd10760a8 am: 7ea99be9d6 am: 4a96283c13 am: dea69941a9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1824633

Change-Id: Ic337e9c6ce69c4c8b02853c3c8a21b29c386b2e1
2021-09-30 13:30:53 +00:00
Mark Chien
869e3a4e38 Merge "Support set test network to tethering upstream" am: 473d864d20 am: da862b2a35 am: 97f9de1efd am: 3e1e57285a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1797991

Change-Id: I723387761bff7539885bc192f4fd300d400fd5f9
2021-09-30 13:30:45 +00:00
markchien
f320c21120 Move runDhcp to TetheringTester
This is a no-op CL which add TetheringTester and move runDhcp related
logic to it.

Test: atest EthernetTetheringTest
Change-Id: Ib1c5647b2bd5a1b27c976450d3aa265aff8f5b70
2021-09-30 12:57:30 +00:00
markchien
7ea99be9d6 Rename mTapPacketReader to mDowntreamReader am: 0bd10760a8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1824633

Change-Id: I1cde888d4502463bbd6d49a3b76f3f8a6d676483
2021-09-30 12:48:20 +00:00
Mark Chien
da862b2a35 Merge "Support set test network to tethering upstream" am: 473d864d20
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1797991

Change-Id: Ifd5c76a943886dfe55e9b68eeb77931dae6fe204
2021-09-30 12:48:15 +00:00
markchien
0bd10760a8 Rename mTapPacketReader to mDowntreamReader
Test: atest EthernetTetheringTest
Change-Id: I2905aba449a2625caf6a82b27b9e43b06191da9f
2021-09-30 12:36:28 +00:00
markchien
2fbd3e72d3 Support set test network to tethering upstream
Test: atest EthernetTetheringTest

Change-Id: Ief2a92bc6c573a6bb75c72b7a0630e5c0accfa73
2021-09-30 10:14:58 +00:00
Treehugger Robot
9ed70df31e Merge "Replace inexact alarm setRepeasting with setExact alarm" am: 507de1cac6 am: 096498601e am: 5318aa5880 am: 5558bbdfe4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1793479

Change-Id: I178968efa8060fc0bb8304489e827d79aee49e06
2021-08-30 15:05:53 +00:00
Treehugger Robot
096498601e Merge "Replace inexact alarm setRepeasting with setExact alarm" am: 507de1cac6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1793479

Change-Id: Ia989bed2395130329ce5946cb7ece91089fc8571
2021-08-30 14:01:49 +00:00
Treehugger Robot
507de1cac6 Merge "Replace inexact alarm setRepeasting with setExact alarm" 2021-08-30 13:42:25 +00:00
Hungming Chen
502d2c28dd Refactor the offload permission check and add tests am: b344870ea0 am: 5dbbd2f132 am: 10fa7b52df am: 9a580968e6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1803422

Change-Id: I54c70f8004ca69714f6f1bebb76b23df238c8b87
2021-08-27 05:48:59 +00:00
Hungming Chen
5dbbd2f132 Refactor the offload permission check and add tests am: b344870ea0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1803422

Change-Id: I857de882e6f613d3bf57d271532f761be10bf988
2021-08-27 05:02:15 +00:00
Hungming Chen
b344870ea0 Refactor the offload permission check and add tests
- Rename the conntrack destination port check function
- Use CollectionUtils.contains to check the denied ports
- Add tests for the streams with ftp and pptp tcp port are
  not able to be offloaded

Bug: 195914327
Test: atest TetheringCoverageTests
Change-Id: I7e2591bea1f6db46271efb0c30970fb8d4efe1e4
2021-08-26 21:21:05 +08:00
Maciej Żenczykowski
b86988211e Merge "Tethering/bpf_progs/offload - replace all TC_ACT_OK with TC_ACT_PIPE" am: dc8388ca08 am: e953144055 am: b43c235eeb am: 0014d2857b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1807971

Change-Id: I56933fb0db02f9cc72c4508e36de18acb575f748
2021-08-25 08:35:21 +00:00
Maciej Żenczykowski
e953144055 Merge "Tethering/bpf_progs/offload - replace all TC_ACT_OK with TC_ACT_PIPE" am: dc8388ca08
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1807971

Change-Id: Iad650917305d67b799d059e4b285af5fd3f54709
2021-08-25 07:37:55 +00:00
Maciej Żenczykowski
dc8388ca08 Merge "Tethering/bpf_progs/offload - replace all TC_ACT_OK with TC_ACT_PIPE" 2021-08-25 07:19:28 +00:00
Maciej Żenczykowski
6e66a36367 Tethering/bpf_progs/offload - replace all TC_ACT_OK with TC_ACT_PIPE
The correct return code to keep on processing any further TC
attached programs is 'TC_ACT_PIPE' and not 'TC_ACT_OK' (which
is terminal).

Without this the ipv6 tether offload program causes termination
of processing and the ipv6 clatd offload program never actually
handles any packets (while tethering is active).

This results in lack of bpf xlat64 offloading for tethered ipv4
traffic on an ipv6-only (cellular) network.

This in turn means incoming TCP packets get GRO'ed, do not get
bpf offloaded, and get delivered to the clat daemon, which
due to them being bigger than the mtu (due to gro) cannot
handle them and discards them.

This results in poor performance, since tcp falls back to 1 mss/mtu
sized packet per rtt.

Tested via tethering a linux laptop on an ipv6-only cellular connection
and downloading the linux kernel from kernel.org via 'wget -6' and 'wget -4'.
Before:
  IPv6: over 2MB/s, observed:
    5805 packets, including 4 sackOK
  IPv4: under 1MB/s, observed:
    9300 packets, including 8 sackOK, 387 sack 1, 501 sack 2, 2310 sack 3
After:
  IPv6: over 7MB/s, observed:
    16702 packets, including 4 sackOK
  IPv4: over 9MB/s, observed:
    32755 packets, including 2 sackOK

Test: builds, TreeHugger, see above
Bug: 195624908
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I623dacb5a37dc689cea34499c3906c11fcaf946c
2021-08-24 23:24:19 +00:00
Lorenzo Colitti
5333597e48 Give EthernetTetheringTest the restricted networks permission. am: 8fbadf4ac5 am: c1256c4cf3 am: e7edc0d8e6 am: 3f28719b10
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1807157

Change-Id: I04ccf491be12236dffb5ba4972fac35946fc6896
2021-08-24 09:45:33 +00:00
Lorenzo Colitti
c1256c4cf3 Give EthernetTetheringTest the restricted networks permission. am: 8fbadf4ac5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1807157

Change-Id: I13defb1e00586393e91ca19100cf437482a64090
2021-08-24 08:54:53 +00:00
Lorenzo Colitti
8fbadf4ac5 Give EthernetTetheringTest the restricted networks permission.
This test fails on devices where physical Ethernet interfaces are
available but marked restricted, like cuttlefish.

Bug: 197462993
Test: test-only change
Change-Id: I15c991b2e43e2d5e823dcdcfbd74adfd9b2f6f08
2021-08-24 15:18:54 +09:00
Lorenzo Colitti
f4aafb9513 Merge "bpf: don't offload IPv4 packets with TCP port 21 (ftp) and 1723 (pptp)" am: ad8fb7fce4 am: b6ea38e832 am: a5688238a0 am: 55910d25ab
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1802476

Change-Id: I0695be6472991aff841914f1080cb2d92f0e7a17
2021-08-20 04:30:24 +00:00
Lorenzo Colitti
b6ea38e832 Merge "bpf: don't offload IPv4 packets with TCP port 21 (ftp) and 1723 (pptp)" am: ad8fb7fce4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1802476

Change-Id: I2ca694a0154b3043092890cfd272e7b86cca3fb5
2021-08-20 03:39:28 +00:00
Lorenzo Colitti
ad8fb7fce4 Merge "bpf: don't offload IPv4 packets with TCP port 21 (ftp) and 1723 (pptp)" 2021-08-20 03:24:09 +00:00
Hungming Chen
bc85178435 bpf: don't offload IPv4 packets with TCP port 21 (ftp) and 1723 (pptp)
Bypass the IPv4 TCP packets with port 21 (ftp) and 1723 (pptp) from
BPF offload because these packets need the netfilter conntrack helper.

Bug: 195914327
Test: manual test as the follows
1. Connect to ftp.slackware.com with port 21 in active mode.
2. Check the PORT command success.
   Command:  PORT 192,168,62,128,174,17
   Response: 200 PORT command successful.
3. Download a file.

Change-Id: I8e3b8d9323eb0e572f20c74442b55d4ee95abc2f
2021-08-19 14:29:25 +00:00
Xin Li
3ec4468fb7 Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: I5a33f959c8ae5a34584f57508f392038e44062e7
Change-Id: Ib4e5e75ee8bbe19806bdc2f69590d164fb75774b
2021-08-14 06:31:05 +00:00
markchien
b763d6f2e2 Use SdkLevel util instead of explicitly checking the version am: 932df54493 am: 682e38c9e8 am: 36733a1509 am: d5740febd6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1793481

Change-Id: I2e9efe489625504a54c0df0237923310cae40d29
2021-08-12 14:53:40 +00:00
markchien
36733a1509 Use SdkLevel util instead of explicitly checking the version am: 932df54493 am: 682e38c9e8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1793481

Change-Id: I1c467221368f4d19346be59e230a0b3424bb4023
2021-08-12 14:24:14 +00:00
markchien
932df54493 Use SdkLevel util instead of explicitly checking the version
There are IpServerTest test case fail because the code check the wrong
code name for T pre-release builds.

Bug: 194812819
Test: atest TetheringTests

Change-Id: I73bf58c60b6e790fe0060b60c023c10f5d8cbfa8
2021-08-12 07:08:34 +00:00
markchien
52158b1d47 Replace inexact alarm setRepeasting with setExact alarm
Use exact alarm to fix entilement recheck delay problem while device
asleep.

Bug: 195370891
Test: atest TehteringTests
Change-Id: I409e603bf2b990657551e1140b50f69640c328d8
2021-08-12 13:32:54 +08:00
Xiao Ma
b027fd877e Merge "Import net-utils-device-common-netlink instead of netlink-client." am: 609e71a46c am: dd7e9e8800 am: f29e0435a9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1753303

Change-Id: Ifa6c95ed9a7ef218cffb53e34acd66bc471aa65f
2021-08-04 08:08:34 +00:00
Xiao Ma
f29e0435a9 Merge "Import net-utils-device-common-netlink instead of netlink-client." am: 609e71a46c am: dd7e9e8800
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1753303

Change-Id: I4fb162f20f5816de1ee1b784cb39533362b34677
2021-08-04 07:56:23 +00:00
Xiao Ma
609e71a46c Merge "Import net-utils-device-common-netlink instead of netlink-client." 2021-08-04 07:27:18 +00:00
Nucca Chen
ad8e96d6ca Merge "Throw an errno exception when open BPF map failed" am: 22d5336279 am: 84c87a49b1 am: e17f852861
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1772440

Change-Id: Ibc93173fcc514d5f3ef91c8425517cb001799deb
2021-08-03 09:09:46 +00:00
Nucca Chen
e17f852861 Merge "Throw an errno exception when open BPF map failed" am: 22d5336279 am: 84c87a49b1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1772440

Change-Id: Ib933a28d7ad5504def71e012a83b9080048fa37e
2021-08-03 09:00:34 +00:00
Nucca Chen
22d5336279 Merge "Throw an errno exception when open BPF map failed" 2021-08-03 08:38:42 +00:00
Hungming Chen
1257e9bfff Throw an errno exception when open BPF map failed
Needed because an invalid file descriptor should notify the caller to
stop using the object.

Bug: 190523685

Test: atest BpfMaptest
Change-Id: I70fb08b54b1c0caa4be4e3f07b59bf4f2397f39d
2021-08-03 08:38:16 +00:00
Remi NGUYEN VAN
880418cd98 Merge "Do not apply jarjar rules on intermediate libs" am: c1e68abd6f am: 4972bf1971 am: 96019d9353
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1778569

Change-Id: I785f61b57eaac0504d34811afc2f342517210e5c
2021-08-03 08:31:35 +00:00
Remi NGUYEN VAN
96019d9353 Merge "Do not apply jarjar rules on intermediate libs" am: c1e68abd6f am: 4972bf1971
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1778569

Change-Id: I4bf35535002bc1ec90913a941923f9c6e0a1c72b
2021-08-03 08:19:31 +00:00
Remi NGUYEN VAN
c1e68abd6f Merge "Do not apply jarjar rules on intermediate libs" 2021-08-03 07:50:29 +00:00
Remi NGUYEN VAN
0015f04ec7 Do not apply jarjar rules on intermediate libs
Using jarjar on intermediate libraries causes issues when they are
combined with other libraries that use different jarjar rules, as the
resulting binary may contain multiple incompatible copies of the
classes. Instead, jarjar should be used on the final artifact, after
combining the libraries.

Ensure NetworkStackJarJarRules is not applied on intermediate libraries
like TetheringIntegrationTestsLib, but instead apply it on
TetheringIntegrationTests or CtsTetheringTest.

Bug: 192535368
Test: atest TetheringCoverageTests TetheringIntegrationTests \
          CtsTetheringTest
Change-Id: I248a533651984de81f676336c0e74e3788610bbb
2021-08-02 19:13:09 +09:00
Remi NGUYEN VAN
7d773d0172 Remove hidden ArrayUtils usage in TetheringTest am: 3dfafbb516 am: 53b6370ec6 am: 6a0a33dcf3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1779756

Change-Id: I4207ea1ab36584f772addcf422dd3facae05e819
2021-07-29 07:56:42 +00:00
Remi NGUYEN VAN
6a0a33dcf3 Remove hidden ArrayUtils usage in TetheringTest am: 3dfafbb516 am: 53b6370ec6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1779756

Change-Id: I715be738618531ae541db589255129149cf4b306
2021-07-29 07:40:07 +00:00
Remi NGUYEN VAN
3dfafbb516 Remove hidden ArrayUtils usage in TetheringTest
Use CollectionUtils instead, which avoids using a hidden API.

Avoiding hidden API usage in tests is good in general, but this also
helps avoid jarjar problems where the com.android.internal.util package
is jarjared to some other package as some of its classes are included
in the module, and ArrayUtils cannot be found in the renamed package.

Bug: 192535368
Test: atest TetheringTest
Change-Id: I54dc8f6429d132a953ab1a674fe349fba4335936
2021-07-28 17:00:20 +09:00
Chalard Jean
120f32e054 Merge "Remove a useless comment" am: c486f0248b am: dcd4438dfa am: 8d83bc0aed
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1777769

Change-Id: I84979fdc0f5ec650fce22eeae9434a67c44c3540
2021-07-27 03:42:10 +00:00
Chalard Jean
8d83bc0aed Merge "Remove a useless comment" am: c486f0248b am: dcd4438dfa
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1777769

Change-Id: Ie372ac7544afa86dd6c8f1298974e307e76f08b3
2021-07-27 03:25:33 +00:00
Chalard Jean
c486f0248b Merge "Remove a useless comment" 2021-07-27 02:59:41 +00:00
Chalard Jean
f126170e98 Remove a useless comment
b/145383354 is obsolete and this works as is (or we'd have found
out by now). Also min SDK version is set in the bp file and
would be overridden anyway.

Test: comment-only change
Change-Id: I6ad3263557ef67aa642672863eed82a312c2ab40
2021-07-27 02:59:11 +00:00
Treehugger Robot
8d3f8c8034 Merge "Add TetheringPrivilegedTests to postsubmit" am: 94ef708b7d am: 6971e4811f am: e3e529150f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1771186

Change-Id: Ifb271be7978b559ded7e6bc21836ece9568cc5a3
2021-07-26 09:26:56 +00:00