Commit Graph

8592 Commits

Author SHA1 Message Date
Treehugger Robot
d77e15c125 Merge "Treat RouteInfo with different interfaces as different routes" 2020-06-17 12:51:08 +00:00
Rubin Xu
bc4c5caa4f Treat RouteInfo with different interfaces as different routes
On Android different interfaces usually use different routing tables.
As a result, a change in interface should not be treated as route
update, but rather a remove and an add.

This change fixes a bug in VPN seamless handover where routes
failed to be updated when a new tunnel interface replaces the existing
one within the same network.

Bug: 158696878
Test: atest com.android.cts.net.HostsideVpnTests
Test: atest NetworkStackTests
Test: atest CtsNetTestCases
Test: atest FrameworksNetTests
Change-Id: I57987233d42a0253eaee2e1ca5f28728c2354620
2020-06-17 12:01:41 +01:00
Aaron Huang
0543f2328d Merge "Add unit test for NetworkStatsSubscriptionsMonitor" 2020-06-17 08:52:20 +00:00
Chiachang Wang
9792742ee0 Merge "Test extra info sent to NetworkMonitor" 2020-06-16 00:38:58 +00:00
Benedict Wong
2f7bb517fd Merge "Set correct owner UID for VPN agentConnect()" 2020-06-15 17:09:46 +00:00
Aaron Huang
b0e7dca43e Add unit test for NetworkStatsSubscriptionsMonitor
Bug: 154080205
Test: atest FrameworksNetTests:com.android.server.net.NetworkStatsSubscriptionsMonitorTest
(copy from ag/11788484 but getActiveAndHiddenSubscriptionIdList() since it's renamed
in internal)
Change-Id: Ia162f36efe96d90b2f6f70190d9fa855bba34484
Merged-In: I4ef3f1ab2e5ea1322133edd80db3ccd0022e9c91
2020-06-15 07:05:19 +00:00
Chiachang Wang
301bc7b40a Test extra info sent to NetworkMonitor
Test extra info sent to NetworkMonitor correctly if network
agent is created through new NetworkAgent constructor without
legacy network info taken as parameter.

Bug: 156173829
Test: atest FrameworkNetTests
Change-Id: I4f827664c528bea30cc957a0a617dd37693f4460
2020-06-12 18:13:00 +08:00
Chalard Jean
f60ed54d33 Merge "Document the limitation to a hundred callbacks." 2020-06-11 12:31:09 +00:00
Chalard Jean
a5ff113bff Document the limitation to a hundred callbacks.
Some developers have been surprised by this limitation and had trouble
figuring out what the issue was. Add documentation to address this.

This also includes a drive-by removal of a duplicate check.

Bug: 149867479
Test: doc-only change
Change-Id: I5911d01984695550b6c9afe7a8eb535bf5e320a1
2020-06-11 12:30:21 +00:00
markchien
e9aad6fa2b Cleanup config_mobile_hotspot_provision_app usage
config_mobile_hotspot_provision_app would be move out of framework and
only private for tethering only.
enforceTetherChangePermission is no longer needed because its only
caller PanService already gate by other privileged permission
(BLUETOOTH_PRIVILEGED).

Bug: 146918263
Test: m

Change-Id: I030871c2bc46bc09c4e52970b4995f98d31bb90e
2020-06-10 15:52:24 +00:00
Benedict Wong
bf004e9830 Set correct owner UID for VPN agentConnect()
This commit changes agentConnect to set the owner UID as the mOwnerUid
field instead of the Binder.getCallingUid().

Binder.getCallingUid() can return incorrect results for platform VPNs,
as agentConnect() is called under a clean calling UID.

Additionally, this relaxes the ownerUid sanitization check to allow a
VPN network's owner to see it's own ownership information.

Vpn.mOwnerUid is guaranteed to be correct, as all VPNs MUST have called
prepareInternal() at some previous point, which sets mOwnerUid as the
package's UID (or SYSTEM_UID if this is legacy VPN).

Bug: 150135470
Test: CTS tests showing ownership information
Change-Id: Ic979dad73983d722365849fbfb0becfd432b894c
2020-06-08 14:33:01 -07:00
Xin Li
551b6e094b Merge "Merge QQ3A.200605.002 into master" 2020-06-06 01:41:11 +00:00
Treehugger Robot
d3068f93c3 Merge "Update javadoc to use complete sentence" 2020-06-05 03:02:36 +00:00
Chiachang Wang
6f9c48b81e Merge "Update extra info before registering" 2020-06-05 00:04:04 +00:00
Chiachang Wang
8b60559b7e Update javadoc to use complete sentence
Avoid using the "iff" abbreviation in our Javadoc.

Bug: 158092978
Test: m doc-comment-check-docs and check the generated doc
Change-Id: I41bf8a6ddad200f00524d9b2dd1bf169810ee460
2020-06-04 07:46:14 +00:00
Chiachang Wang
9774ceb3ea Update extra info before registering
The extra info is taken into NetworkMonitor from while creating
it. The NetworkMonitor is created when a new agent is registered
but the extra info is not available at that time. Make sure the
field is set in the NetworkInfo when registering.

Bug: 156173829
Test: adb shell dumpsys network and check the apn in the extra
      info shown correctly
Test: atest FrameworkNetTests
Change-Id: Ieaad8cbf1a28af3b97c7f98f74358e417fcad661
2020-06-03 13:01:01 +08:00
Junyu Lai
528f5debe1 Merge "Disable log for per uid blocked status changed event" am: d66468ca25
Original change: undetermined

Change-Id: I6ba38a19e1ac1d7f3f3eccef76aa10f75273ca47
2020-06-02 09:52:38 +00:00
Junyu Lai
d66468ca25 Merge "Disable log for per uid blocked status changed event" 2020-06-02 09:39:30 +00:00
junyulai
31a6c32056 Disable log for per uid blocked status changed event
This consumes ~3.5% system logs, however it is not very useful
when debugging since similar information could be obtained from
dumpsys {connectivity|netpolicy}. Thus, remove the log.

Test: manual
Bug: 135504481
Change-Id: I04d2b7402f892546722fe6868c521afd9534f183
2020-06-02 14:26:36 +08:00
Maciej Żenczykowski
5b8a4a37af Merge "Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS" am: 4bf80c0b90
Change-Id: I4128678546feba6840ddb210244992846705e5d9
2020-06-01 02:14:25 +00:00
Maciej Żenczykowski
4bf80c0b90 Merge "Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS" 2020-06-01 02:00:40 +00:00
Luke Huang
c9dcbcd597 Add dnsproxyd_protocol_headers for NETID_USE_LOCAL_NAMESERVERS
NETID_USE_LOCAL_NAMESERVERS is no longer in libnetd_client

Bug: 151895202
Test: build
Change-Id: Iea0c2488dcabdd24d6ffca8134cd11ed12e8308a
Merged-In: Iea0c2488dcabdd24d6ffca8134cd11ed12e8308a
2020-05-30 19:04:44 -07:00
Remi NGUYEN VAN
54c3c2b3c7 Merge "Allow TRANSPORT_TEST ethernet networks" am: 6642ec61c3
Change-Id: Ib9ab1ddb855c90219e94c4b74dc7268cfbcdb661
2020-05-29 21:43:41 +00:00
Benedict Wong
29879886c9 Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" am: de684cfa06
Change-Id: I4a135e75105a49b25b65ba76a3c252467bd9d5ea
2020-05-29 21:41:40 +00:00
Remi NGUYEN VAN
6642ec61c3 Merge "Allow TRANSPORT_TEST ethernet networks" 2020-05-29 06:26:14 +00:00
Benedict Wong
de684cfa06 Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" 2020-05-29 01:55:08 +00:00
Remi NGUYEN VAN
656c566cf1 Allow TRANSPORT_TEST ethernet networks
Ethernet networks using tap interfaces should have TRANSPORT_TEST so
they are not considered by network selection.

Test: atest CaptivePortalApiTest FrameworksNetTests
Bug: 156319532
Change-Id: I0d9477977c88aa055625ab4046577a41e76b05ff
2020-05-29 10:22:50 +09:00
Treehugger Robot
843c1661c7 Merge changes I289d935f,I0121a4ac am: 84af34369d
Change-Id: I7c413c9e1f2efc3aba55453c6b98bf682f3d4116
2020-05-28 10:55:48 +00:00
Treehugger Robot
84af34369d Merge changes I289d935f,I0121a4ac
* changes:
  NetworkStats: apply464xlatAdjustments - don't remove CLAT_UID
  NetworkStats: apply464xlatAdjustments - remove useBpfStats parameter.
2020-05-28 10:34:01 +00:00
Maciej Żenczykowski
62cf792d3f Merge changes Ie73ba058,I4393afcb,Ifebd946e,Ib12ee882,Ia171b779 am: 9fb791c62d
Change-Id: I7b9ae6590c67f89b023417e511fa823b79ad53b1
2020-05-28 09:18:16 +00:00
Maciej Żenczykowski
9fb791c62d Merge changes Ie73ba058,I4393afcb,Ifebd946e,Ib12ee882,Ia171b779
* changes:
  fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting100MBDownload
  fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting
  fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccountingSimple
  fix android.net.NetworkStatsTest#testApply464xlatAdjustments
  NetworkStats - no need for xt_qtaguid clat bw fixups
2020-05-28 09:04:42 +00:00
Maciej Żenczykowski
bcd2b09b35 NetworkStats: apply464xlatAdjustments - don't remove CLAT_UID
This should no longer be needed after all the cleanups.

Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I289d935f84b616ed857ef4c5a7427d57c282d00c
2020-05-28 01:47:30 -07:00
Maciej Żenczykowski
4bfcfc5f02 NetworkStats: apply464xlatAdjustments - remove useBpfStats parameter.
Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0121a4ac7ee824adc5930bab786d550b2f00b05b
2020-05-28 01:33:25 -07:00
Maciej Żenczykowski
b053a337e3 fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting100MBDownload
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

(so just copy over the rx stats from the before file)

Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie73ba0586dafde67bc2726db26e07f7268c18be3
2020-05-28 00:26:18 -07:00
Maciej Żenczykowski
2cc6ec11d7 fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

Test: atest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4393afcbe8e1bb886ecf4f5c1573f6ac8a0e29f5
2020-05-28 00:26:18 -07:00
Maciej Żenczykowski
51531ee376 fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccountingSimple
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

Test: atest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ifebd946e06b5fa2eeb7ff4fc0b1c423097021692
2020-05-28 00:26:18 -07:00
Maciej Żenczykowski
f24ada13aa fix android.net.NetworkStatsTest#testApply464xlatAdjustments
Test: atest NetworkStatsTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib12ee88295eb502f6da13d212b4fd6298dea380f
2020-05-28 00:26:18 -07:00
Chalard Jean
3d2d28eac5 Merge "Adjust tests for renaming groupHint to cluster." am: f1b1600637
Change-Id: I65d0298b17b60c9b4266766bf74928bf967c8b60
2020-05-28 04:29:24 +00:00
Chalard Jean
f1b1600637 Merge "Adjust tests for renaming groupHint to cluster." 2020-05-28 04:20:26 +00:00
Cody Kesting
f67675fb76 Merge "Comment reason for simulateDataStall structure." am: f79e9c87aa
Change-Id: I4ef90859ba5a9b4a829016f7b20711d8734492e4
2020-05-27 17:24:20 +00:00
Cody Kesting
f79e9c87aa Merge "Comment reason for simulateDataStall structure." 2020-05-27 17:11:57 +00:00
Benedict Wong
d196714698 Add RequiresFeature annotations for IKEv2 VPN profiles
This change adds the @RequiresFeature annotation to Ikev2VpnProfile
Builder methods, and checks before provisioning VPN profiles.

Bug: 156681625
Test: New tests added, passing.
Change-Id: I125d8fbe5d67fb877ad7d0636c007cb3e1a9f59b
2020-05-27 02:05:49 -07:00
Lorenzo Colitti
df775be39f Merge "Inform the DNS resolver when it needs to do DNS64 synthesis." am: c0ba5bf41d
Change-Id: Ia18f83bd6a22f255bf17792ebc14e485810a39cd
2020-05-26 09:49:13 +00:00
Lorenzo Colitti
c0ba5bf41d Merge "Inform the DNS resolver when it needs to do DNS64 synthesis." 2020-05-26 09:26:46 +00:00
Lorenzo Colitti
fcf8e6a45a Merge "Test that if an RA sets the same prefix as DNS, nothing happens." am: eafdd034f8
Change-Id: I61f7ad698fb5b086f5e284309a21f56314d8163f
2020-05-24 11:17:02 +00:00
Lorenzo Colitti
eafdd034f8 Merge "Test that if an RA sets the same prefix as DNS, nothing happens." 2020-05-24 10:59:40 +00:00
Cody Kesting
8c5375cec3 Merge "Forward unknown Data Stall types to Connectivity Diagnostics." am: b10df0da89
Change-Id: Ifc49eb81c219d1ba036c11887e2bc686a68dd67d
2020-05-21 23:19:30 +00:00
Cody Kesting
b10df0da89 Merge "Forward unknown Data Stall types to Connectivity Diagnostics." 2020-05-21 22:58:29 +00:00
Cody Kesting
652e3ec4f1 Comment reason for simulateDataStall structure.
This change adds a comment to CS#simulateDataStall to explain why the
Data Stall is wrapped in a DataStallReportParcelable before being passed
to the ConnectivityDiagnostics handler. This approach is taken to ensure
that simulated data stalls are handled the exact same as Data Stalls
received directly from NetworkMonitor (including Data Stalls detected by
methods that the platform does not understand).

Bug: 156294356
Test: atest ConnectivityDiagnosticsManager
Change-Id: I751054418bf328c72b977a1cc99c27cb9b8ab7ba
2020-05-21 12:08:21 -07:00
Lorenzo Colitti
b432bc75e5 Inform the DNS resolver when it needs to do DNS64 synthesis.
This is only necessary when learning the NAT64 prefix from the
RA, because if the NAT64 prefix is learned from DNS, the DNS
resolver already knows the prefix and automatically enables
DNS64 synthesis.

The DNS resolver needs to be informed of the prefix any time
clat is running on a prefix learned from an RA. This is simple to
implement: just set the prefix when starting clat if prefix
discovery is not running, and clear the prefix when stopping clat
if prefix discovery was not running. This ensures that the prefix
is cleared iff it was set.

Bug: 156914456
Test: new unit test coverage
Change-Id: If8ad2d30712a6df3e207c8d3e8a129705242191e
2020-05-21 23:32:57 +09:00