Commit Graph

9576 Commits

Author SHA1 Message Date
Maciej Żenczykowski
d08aecf08f Merge changes Ie73ba058,I4393afcb,Ifebd946e,Ib12ee882,Ia171b779 am: 9fb791c62d am: 62cf792d3f
Change-Id: If8abb4247759462532cbac6b43bfb8d3202c6e34
2020-05-28 09:36:05 +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
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
53f0c18b8a Merge "Adjust tests for renaming groupHint to cluster." am: f1b1600637 am: 3d2d28eac5
Change-Id: Ifd2d659c4c386fb8895230ffc85b2a9086ee1a84
2020-05-28 04:41:05 +00: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
0e42e708e2 Merge "Comment reason for simulateDataStall structure." am: f79e9c87aa am: f67675fb76
Change-Id: Ie236cb45cb2192702df4ce9aaa4e3db7fa1e007c
2020-05-27 17:55:03 +00:00
Benedict Wong
e1fc3ee141 [automerger skipped] Merge "Add methods for IKEv2/IPsec test mode profiles" into rvc-dev am: 363674479d -s ours
am skip reason: Change-Id I2511b39b27a1e29ae97907cdb12728d13fb1628f with SHA-1 0d7bed76cb is in history

Change-Id: I07603bd3f06b5e8b84d778ec5a72f373cbbd2c2f
2020-05-27 17:32:47 +00:00
Benedict Wong
363674479d Merge "Add methods for IKEv2/IPsec test mode profiles" into rvc-dev 2020-05-27 17:31:00 +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
Cody Kesting
f7c8078532 [automerger skipped] Merge "Forward unknown Data Stall types to Connectivity Diagnostics." into rvc-dev am: 4f8514c545 -s ours
am skip reason: Change-Id I62d0bf91fcc17c7921afd519c72551399906bd6b with SHA-1 b37958eec9 is in history

Change-Id: Ie80d01ef3c50a85b55d54161c98126c49d46c4af
2020-05-27 16:17:36 +00:00
Cody Kesting
4f8514c545 Merge "Forward unknown Data Stall types to Connectivity Diagnostics." into rvc-dev 2020-05-27 16:03:38 +00:00
Lorenzo Colitti
7e93b0f511 [automerger skipped] Inform the DNS resolver when it needs to do DNS64 synthesis. am: 37aa693fb5 -s ours
am skip reason: Change-Id If8ad2d30712a6df3e207c8d3e8a129705242191e with SHA-1 b432bc75e5 is in history

Change-Id: Iec52ca510f3c066abbd96636c595acb89828c29a
2020-05-26 14:29:28 +00:00
Lorenzo Colitti
bf9c472efa [automerger skipped] Test that if an RA sets the same prefix as DNS, nothing happens. am: 0424f88915 -s ours
am skip reason: Change-Id I3316d49d42100800740afadc4edf0a13a4d8377c with SHA-1 16b28e2b22 is in history

Change-Id: I3e050057ba6ac95d789ed7f34f390bec586d84b7
2020-05-26 12:58:24 +00:00
Lorenzo Colitti
37aa693fb5 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
Original-Change: https://android-review.googlesource.com/1315578
Merged-In: If8ad2d30712a6df3e207c8d3e8a129705242191e
Change-Id: If8ad2d30712a6df3e207c8d3e8a129705242191e
2020-05-26 11:52:35 +00:00
Lorenzo Colitti
0424f88915 Test that if an RA sets the same prefix as DNS, nothing happens.
This is not particularly likely to happen unless the pref64 RA is
sent by a different router than the main RA. But more tests are
always good, and this additional coverage will be more useful
in an upcoming change.

Bug: 150648313
Test: test-only change
Original-Change: https://android-review.googlesource.com/1316094
Merged-In: I3316d49d42100800740afadc4edf0a13a4d8377c
Change-Id: I3316d49d42100800740afadc4edf0a13a4d8377c
2020-05-26 11:35:33 +00:00
Lorenzo Colitti
79fde3a970 Merge "Inform the DNS resolver when it needs to do DNS64 synthesis." am: c0ba5bf41d am: df775be39f
Change-Id: I06278ddff31d8c0dbb4ce6cfded01a38369d8a3c
2020-05-26 10:13:17 +00: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
cc2ab62176 Merge "Test that if an RA sets the same prefix as DNS, nothing happens." am: eafdd034f8 am: fcf8e6a45a
Change-Id: Ib2eb07e3794630cc636759ce6a6529b7b56a3cfe
2020-05-24 11:30:55 +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
80aec1d4ff Forward unknown Data Stall types to Connectivity Diagnostics.
This CL forwards suspected Data Stall events detected with unknown
detection methods to ConnectivityDiagnostics.

Currently, ConnectivityService drops any data stall events with unknown
detection methods, which leads to false negatives for Connectivity
Diagnostics registrants. This change ensures that registrants will still
be notified as NetworkStack is updated to use new detection methods.

The documentation for ConnectivityDiagnosticsManager#DataStallReport is
also updated to reflect that the detection methods included in the
report are a bit mask of detection methods used. Implicitly, this means
that data stalls detected via unknown methods will have an empty bit
mask (0x00).

Bug: 156294356
Test: atest ConnectivityDiagnosticsManager
Change-Id: I62d0bf91fcc17c7921afd519c72551399906bd6b
Merged-In: I62d0bf91fcc17c7921afd519c72551399906bd6b
(cherry picked from commit a1d9d811a05bf3447ebb90a39343b53eee79f0db)
2020-05-22 19:12:14 +00:00
Cody Kesting
1dc1ba0bb0 Merge "Forward unknown Data Stall types to Connectivity Diagnostics." am: b10df0da89 am: 8c5375cec3
Change-Id: I31d17c5c353e822f3d48166ffe9cc39abd31c198
2020-05-21 23:35:38 +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
Cody Kesting
0880e7a979 [automerger skipped] Merge "Move Data Stall logic to CS from NetworkMonitorCallbacks." into rvc-dev am: 9b616b851f -s ours
am skip reason: Change-Id Ie2f6a1a2376c5c452750ab417cb5e8c24fc44fc3 with SHA-1 f5cc4eae9e is in history

Change-Id: I376f8021b63cc21393de7eba8f0ad26650eedab5
2020-05-21 16:04:17 +00:00
Cody Kesting
9b616b851f Merge "Move Data Stall logic to CS from NetworkMonitorCallbacks." into rvc-dev 2020-05-21 16:01:01 +00: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
Treehugger Robot
da847627ad Merge "Suppress deprecation warnings in LegacyTypeTrackerTest." am: 8d55b55f60 am: 2911ce534e
Change-Id: I77fdf03484bd0da36ebffd025a33ab4859a0a5a2
2020-05-21 08:31:13 +00:00
Lorenzo Colitti
16b28e2b22 Test that if an RA sets the same prefix as DNS, nothing happens.
This is not particularly likely to happen unless the pref64 RA is
sent by a different router than the main RA. But more tests are
always good, and this additional coverage will be more useful
in an upcoming change.

Bug: 150648313
Test: test-only change
Change-Id: I3316d49d42100800740afadc4edf0a13a4d8377c
2020-05-21 17:26:00 +09:00
Treehugger Robot
2911ce534e Merge "Suppress deprecation warnings in LegacyTypeTrackerTest." am: 8d55b55f60
Change-Id: If35be28eac763d01b99078f171da8ff56d90d93f
2020-05-21 08:11:05 +00:00
Treehugger Robot
8d55b55f60 Merge "Suppress deprecation warnings in LegacyTypeTrackerTest." 2020-05-21 07:47:45 +00:00
Chalard Jean
4a038d3874 [automerger skipped] Merge "Address nit from aosp/1301317" into rvc-dev am: 9024f27f97 -s ours
am skip reason: Change-Id If5e5439b22f05e08a293fd83da4d54f6a4363ca5 with SHA-1 4f8109f638 is in history

Change-Id: Ifaf50fb9e04b1403cc75d9002e46c6955e111a40
2020-05-21 07:04:30 +00:00
Chalard Jean
447cc67342 [automerger skipped] Merge "Fix a bug where VPNs start out suspended on cellular" into rvc-dev am: 5c721ed487 -s ours
am skip reason: Change-Id I3e4ff990c0d4825b21c7679be29a482a2d1324ec with SHA-1 fbd6a2c012 is in history

Change-Id: I22ecee256894e850f85ab02b299136283ebe9a08
2020-05-21 07:03:53 +00:00
Chalard Jean
24967f01d6 [automerger skipped] Merge "Fix a bug where a spurious capabilities callback is sent." into rvc-dev am: acdacbfe65 -s ours
am skip reason: Change-Id Id7d8bba486bada1a7ba5b0f152d2aa02e407f249 with SHA-1 d568791283 is in history

Change-Id: I655cca7c9e1ba6ba4fae95b221b1e46e91da5f6d
2020-05-21 07:02:51 +00:00
Chalard Jean
9024f27f97 Merge "Address nit from aosp/1301317" into rvc-dev 2020-05-21 06:44:30 +00:00
Chalard Jean
5c721ed487 Merge "Fix a bug where VPNs start out suspended on cellular" into rvc-dev 2020-05-21 06:43:56 +00:00
Treehugger Robot
4a7eb2a5d2 Address nit from aosp/1301317
Test: atest ConnectivityServiceTest#testVpnSetUnderlyingNetworks
Bug: 150570873
Original-Change: https://android-review.googlesource.com/1307374
Merged-In: If5e5439b22f05e08a293fd83da4d54f6a4363ca5
Change-Id: If5e5439b22f05e08a293fd83da4d54f6a4363ca5
2020-05-21 05:12:41 +00:00
Chalard Jean
ebbece8b22 Fix a bug where VPNs start out suspended on cellular
As NetworkAgent is in a transition where all agents need
to include the NOT_SUSPENDED capability as part of their
migration to the system API, ConnectivityService adds it
forcefully to all agents that don't have the CELLULAR
transport. This doesn't include VPNs when VPNs have some
cellular network as their underlying network.

The best way to solve this is to make sure the VPN
capabilities reflect those of the underlying networks as
far as the NOT_SUSPENDED capability is concerned. This
is how they work for other similar capabilities.

This also happens to contain a drive-by fix for an issue
with a spurious capabilities callback is triggered when
a VPN connects and it has any underlying network (which
means almost always, because it will take the default
network if it doesn't declare any). Fixing this was
necessary to have a cogent test of this issue, but it
could be moved to another patch or it could stay unfixed
with some minor ajustment to the tests if judged too
dangerous to include in R at this point.

Test: New tests in this patch. Also manually tested with
      tcpdump as described in b/150570873.
Bug: 150570873
Original-Change: https://android-review.googlesource.com/1301317
Merged-In: I3e4ff990c0d4825b21c7679be29a482a2d1324ec
Change-Id: I3e4ff990c0d4825b21c7679be29a482a2d1324ec
2020-05-21 05:10:37 +00:00
Chalard Jean
bee5b3f227 Fix a bug where a spurious capabilities callback is sent.
When a VPN connects and it has any underlying network (which
means almost always, because it will take the default network
if it doesn't declare any), it has default capabilities and
will only take the capabilities of its underlying network
as part of an update happening after making the network
available but before the rematch can take place. This in turn
causes the capabilities callback sent as part of the rematch
to be spuriously sent.

Test: FrameworksNetTests. Also tested together with a
      followup that adds tests with drive-by coverage for this.
Bug: 150570873
Original-Change: https://android-review.googlesource.com/1305393
Merged-In: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249
Change-Id: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249
2020-05-21 05:09:15 +00:00
Lorenzo Colitti
84f1909fb1 Suppress deprecation warnings in LegacyTypeTrackerTest.
This saves dozens of warnings every time FrameworkNetTests is
compiled. There is nothing we can do about those warnings because
LegacyTypeTracker's reason for existence is to power deprecated
APIs.

Test: m FrameworksNetTests
Change-Id: I4d65b0aade493e12b56a94247efbf9d1ad7bb4b9
2020-05-20 20:53:16 +09:00
Remi NGUYEN VAN
7909635637 Merge "Add integration test for capport API" am: f2853503c3 am: d7b408a8d8
Change-Id: Ib0051ca4bf36f88cac7ab15741c0a7e8bc53c005
2020-05-20 09:42:15 +00:00
Remi NGUYEN VAN
d7b408a8d8 Merge "Add integration test for capport API" am: f2853503c3
Change-Id: I9e4ebb0e6746806a466544261def371eff4c8e21
2020-05-20 09:41:45 +00:00