Commit Graph

1594 Commits

Author SHA1 Message Date
Maciej Żenczykowski
e0131e56ae Merge changes Ie73ba058,I4393afcb,Ifebd946e,Ib12ee882,Ia171b779 am: e273042404 am: e0f1768048 am: 42f451c579 am: b26855f1bb am: 44ceb47bd4
Change-Id: I067445d4b712184da693a9cb15c0309fd9f2ff0d
2020-05-28 10:30:55 +00:00
Maciej Żenczykowski
42f451c579 Merge changes Ie73ba058,I4393afcb,Ifebd946e,Ib12ee882,Ia171b779 am: e273042404 am: e0f1768048
Change-Id: If8abb4247759462532cbac6b43bfb8d3202c6e34
2020-05-28 09:36:05 +00:00
Maciej Żenczykowski
c1aeb69e59 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
3f9933c48d 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
Lorenzo Colitti
13decc194b Merge "Inform the DNS resolver when it needs to do DNS64 synthesis." am: 808cb66c50 am: eae6b8a201 am: 8c0378e7e8 am: 7d669cded7 am: 66176cd9c5
Change-Id: I6bb6f038af9988502f15894349039fec51dc8a86
2020-05-26 10:59:30 +00:00
Lorenzo Colitti
8c0378e7e8 Merge "Inform the DNS resolver when it needs to do DNS64 synthesis." am: 808cb66c50 am: eae6b8a201
Change-Id: I06278ddff31d8c0dbb4ce6cfded01a38369d8a3c
2020-05-26 10:13:17 +00:00
Lorenzo Colitti
808cb66c50 Merge "Inform the DNS resolver when it needs to do DNS64 synthesis." 2020-05-26 09:26:46 +00:00
Lorenzo Colitti
abe31686e8 Merge "Test that if an RA sets the same prefix as DNS, nothing happens." am: 68a9de91fe am: 59d8d9afbb am: 0525f31d6b am: 1f3d6ceef8 am: bc6e27895f
Change-Id: I58fbdf5bf51a1048acf61bd25107e2f2caa86617
2020-05-24 12:14:57 +00:00
Lorenzo Colitti
0525f31d6b Merge "Test that if an RA sets the same prefix as DNS, nothing happens." am: 68a9de91fe am: 59d8d9afbb
Change-Id: Ib2eb07e3794630cc636759ce6a6529b7b56a3cfe
2020-05-24 11:30:55 +00:00
Lorenzo Colitti
68a9de91fe Merge "Test that if an RA sets the same prefix as DNS, nothing happens." 2020-05-24 10:59:40 +00:00
Lorenzo Colitti
82bb897e87 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
54b0fb1323 Merge "Suppress deprecation warnings in LegacyTypeTrackerTest." am: 6e830b854e am: 5b3e7d90d0 am: 1233f72fab am: 192074f36e am: de1c84a371
Change-Id: Ia7a29777227d1780e620c6c6b0ad84925512be12
2020-05-21 09:17:22 +00:00
Treehugger Robot
1233f72fab Merge "Suppress deprecation warnings in LegacyTypeTrackerTest." am: 6e830b854e am: 5b3e7d90d0
Change-Id: I77fdf03484bd0da36ebffd025a33ab4859a0a5a2
2020-05-21 08:31:13 +00:00
Lorenzo Colitti
4afb82b32e 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
6e830b854e Merge "Suppress deprecation warnings in LegacyTypeTrackerTest." 2020-05-21 07:47:45 +00:00
Lorenzo Colitti
d61f5f7dc1 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
Treehugger Robot
d9d2d7c3f9 Merge "Address nit from aosp/1301317" am: f0edf03f5b am: b1f5f8d5fe am: bb72b5360d am: 64e51fe556 am: 371c751f8b
Change-Id: Id24f6eadf126616a8585ce56aef0de7f1c68c44b
2020-05-15 08:15:35 +00:00
Treehugger Robot
bb72b5360d Merge "Address nit from aosp/1301317" am: f0edf03f5b am: b1f5f8d5fe
Change-Id: I7ae9b80954309b18eb6923da3aeaab3d1b8e3231
2020-05-15 07:14:29 +00:00
Treehugger Robot
f0edf03f5b Merge "Address nit from aosp/1301317" 2020-05-15 06:43:42 +00:00
Benedict Wong
9e18eeb4a6 Merge "Add methods for IKEv2/IPsec test mode profiles" am: f44b90fdc4 am: 8b0b9d8a26 am: d84c77544b am: faea94fccd am: c4b78b72fd
Change-Id: Ica5592c8b02effa49a8d672fb30ee703147e025e
2020-05-15 03:50:20 +00:00
Benedict Wong
d84c77544b Merge "Add methods for IKEv2/IPsec test mode profiles" am: f44b90fdc4 am: 8b0b9d8a26
Change-Id: I353d999ebcdd108a900abfe20be232e83147b6d2
2020-05-15 02:51:43 +00:00
Benedict Wong
f44b90fdc4 Merge "Add methods for IKEv2/IPsec test mode profiles" 2020-05-15 02:18:02 +00:00
Benedict Wong
63d2bfd257 Add methods for IKEv2/IPsec test mode profiles
This change adds the ability for IKEv2/IPsec VPN profiles to run on Test
Networks. If enabled, the IKEv2/IPsec VPN profiles will request ONLY
test networks.

Bug: 148582947
Test: FrameworksNetTests passing
Test: Added for testing
Change-Id: I2511b39b27a1e29ae97907cdb12728d13fb1628f
2020-05-12 22:55:55 -07:00
Cody Kesting
35782280a2 Merge "Set owner and administrator UIDs for test networks." am: b54e6b4377 am: 9f62246445 am: b07eaa5015 am: 8b9d02bc50 am: a68878a09d
Change-Id: I4925d5a7f9c4dd063e87b138806a7b562a7390e4
2020-05-12 18:47:10 +00:00
Cody Kesting
b07eaa5015 Merge "Set owner and administrator UIDs for test networks." am: b54e6b4377 am: 9f62246445
Change-Id: I7af702ff5eafbd0f5bb2247e0debf975e51accd1
2020-05-12 17:26:44 +00:00
Cody Kesting
b54e6b4377 Merge "Set owner and administrator UIDs for test networks." 2020-05-12 16:52:07 +00:00
Chalard Jean
f9f6cf7270 Merge "Fix a bug where VPNs start out suspended on cellular" am: bd3a7f994d am: c84f5a0713 am: 983f827366 am: c4e3c258b6 am: 8a05c86ded
Change-Id: I94536a7867592ea4c2823f6dcaad1ac4420a3230
2020-05-11 05:41:59 +00:00
Chalard Jean
983f827366 Merge "Fix a bug where VPNs start out suspended on cellular" am: bd3a7f994d am: c84f5a0713
Change-Id: I368308ded731b221be7fae6ddf1723c587ae4d20
2020-05-11 04:59:35 +00:00
Chalard Jean
1f6f7241ec Address nit from aosp/1301317
Test: atest ConnectivityServiceTest#testVpnSetUnderlyingNetworks
Bug: 150570873
Change-Id: If5e5439b22f05e08a293fd83da4d54f6a4363ca5
2020-05-11 13:25:16 +09:00
Chalard Jean
bd13c96a69 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
Change-Id: I3e4ff990c0d4825b21c7679be29a482a2d1324ec
2020-05-11 10:44:50 +09:00
Chalard Jean
9d2f3b811e Merge "Fix a bug where a spurious capabilities callback is sent." am: 9ef70c4bd6 am: fd3eac2fdf am: 8add478ef7 am: 8e94f196a9 am: 6d0bfc8bab
Change-Id: I18ba5d615df6c8a43aca01563f97ac451b48493a
2020-05-08 02:35:29 +00:00
Chalard Jean
8add478ef7 Merge "Fix a bug where a spurious capabilities callback is sent." am: 9ef70c4bd6 am: fd3eac2fdf
Change-Id: Ied089ed5ca553b206bdb3f7195f9e623aaabfa00
2020-05-08 01:33:13 +00:00
Chalard Jean
9ef70c4bd6 Merge "Fix a bug where a spurious capabilities callback is sent." 2020-05-08 00:49:33 +00:00
Chalard Jean
d584c263b3 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
Change-Id: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249
2020-05-07 12:07:03 +09:00
junyulai
c4fd5119f3 [SM10] Adopt helper class to monitor RAT type change per sub
Test: atest NetworkStatsServiceTest
Bug: 146415925
Change-Id: I45c3aa9046b316c8cd0943543d620a22e4afefd1
Merged-In: I45c3aa9046b316c8cd0943543d620a22e4afefd1
(cherry picked from commit 219faff07b)
2020-05-05 18:37:29 +08:00
Chiachang Wang
7a06fca3a5 Merge changes I3525edc3,I6e18915e am: c861b10841 am: 31f2f386ce am: 5e0437f1e2 am: 171c6a9641 am: 03cb21db6c
Change-Id: Ibe3182636251cb16c42e93bf886de01908de8fb9
2020-04-29 10:12:42 +00:00
Chiachang Wang
5e0437f1e2 Merge changes I3525edc3,I6e18915e am: c861b10841 am: 31f2f386ce
Change-Id: I85b8798fc82873d22c338937bb61092fbde259e6
2020-04-29 09:24:10 +00:00
Chiachang Wang
34bbc85569 Filter debug entries for each vpn
NetworkStats calculation needs to filter out debug entries to
prevent over counting. While NetworkStatsFactory migrates data
usage over a VPN to the TUN network, NetworkStatsFactory does
not filter out debug entries per vpn which will cause debug
entries left and cause exception.

Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
      and verify no exception
Change-Id: I3525edc385b07858b48c7add2d331c4b5a2e84ad
2020-04-29 15:07:45 +08:00
Chiachang Wang
8563394015 Add test prefix into test cases
Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
Change-Id: I6e18915e383ac20072cb238d0136d7a8e4ceb811
2020-04-29 13:44:50 +08:00
Cody Kesting
47cf27f64d Set owner and administrator UIDs for test networks.
This change sets the owner and administrator UIDs for test networks when
their initial values match the UID for the app creating the test
network. This ensures that apps registering test networks can only make
themselves owners / administrators of the network.

Bug: 153449964
Test: atest NetworkAgentTest
Change-Id: I3a974700aa1d83cb285295ed1de0aa263e2e5b58
2020-04-27 20:54:57 -07:00
Benedict Wong
524b051a4a Merge "Add tests for Tunnel, Transport mode application with released SPIs" am: 203b7a7c0d am: 75b7dc67ee am: f12fc1f9c0 am: a9316d9ef1 am: 88b58644ec
Change-Id: Ib51f876bc8e29c8c5eed2cfa887edc6702a6059c
2020-04-25 00:12:17 +00:00
Benedict Wong
774c6e9881 Merge "Use TransformRecord to get SPI instead of SpiRecord" am: 3a28eabc52 am: afa7540566 am: 0ff214984b am: 15cae60b6a am: b568780e01
Change-Id: I01b210e1db69a625a9c208ee58528a95ef57744d
2020-04-25 00:12:07 +00:00
Benedict Wong
f12fc1f9c0 Merge "Add tests for Tunnel, Transport mode application with released SPIs" am: 203b7a7c0d am: 75b7dc67ee
Change-Id: I91a4f355cd2a397a9f24c0d5f5381a51523a1fe0
2020-04-24 23:27:48 +00:00
Benedict Wong
0ff214984b Merge "Use TransformRecord to get SPI instead of SpiRecord" am: 3a28eabc52 am: afa7540566
Change-Id: Ibc3090627699aecb4ab5e183219b5848005d0412
2020-04-24 23:27:36 +00:00
Benedict Wong
203b7a7c0d Merge "Add tests for Tunnel, Transport mode application with released SPIs" 2020-04-24 22:32:41 +00:00
Benedict Wong
3a28eabc52 Merge "Use TransformRecord to get SPI instead of SpiRecord" 2020-04-24 22:32:41 +00:00
Remi NGUYEN VAN
97d2e0fbb7 Merge "Address comments on NetworkStack AIDL v6" am: 152c94589a am: ae5a939d1f am: 0034af63b1 am: c883ab56df am: 352a2ac972
Change-Id: Ida22c941d7570e966c0b51b4561f1ed229243757
2020-04-24 12:55:39 +00:00
Remi NGUYEN VAN
0034af63b1 Merge "Address comments on NetworkStack AIDL v6" am: 152c94589a am: ae5a939d1f
Change-Id: Id385210ccd8d08bc2d15e964bbca25c452a3cde8
2020-04-24 12:19:37 +00:00
Remi NGUYEN VAN
152c94589a Merge "Address comments on NetworkStack AIDL v6" 2020-04-24 11:56:32 +00:00
Remi NGUYEN VAN
b955ac2f73 Address comments on NetworkStack AIDL v6
Address issues found during AIDL review:
 - Rename clientAddr to singleClientAddr
 - Do not use a ParcelableBundle for notifyNetworkTested or
   notifyDataStallSuspected; instead use AIDL parcelables for stronger
   backwards compatibility guarantees.

Test: atest NetworkMonitorTest ConnectivityServiceTest
      ConnectivityServiceIntegrationTest, manual
Bug: 153500847
Change-Id: Id9b71784e5f6294d203230e57737979e063ff0f8
2020-04-24 18:52:02 +09:00