Commit Graph

1621 Commits

Author SHA1 Message Date
Jeff Davidson
157cb03474 Merge "Update network selections on capability change." into lmp-mr1-dev 2014-11-05 17:41:36 +00:00
Jeff Davidson
d36242ae5d Update network selections on capability change.
Among other reasons, this is needed when a Wi-Fi connection is
upgraded from untrusted to trusted, so that the default route can be
updated to point to the Wi-Fi network instead.

Bug: 18206275
Change-Id: I53f7a6f00f66a23ae4873fa2334cd8a621f39d4f
2014-11-04 16:48:27 -08:00
Sreeram Ramachandran
d9bf64ba1d Don't use framework permission strings for netd permissions.
These framework permission strings were being used as arbitrary labels
that mapped to netd permissions that have completely different meaning.
This leads to confusion, so use different strings.

Bug: 18194858
Change-Id: Ib3ec377ab26ce904d3d4678f04edec6cb1260517
2014-11-04 10:15:03 -08:00
Lorenzo Colitti
1b11eb6480 Merge "Enable 464xlat on wifi." into lmp-mr1-dev 2014-10-30 13:28:03 +00:00
Lorenzo Colitti
35bffcdd58 Merge "Add support for running 464xlat on wifi as well." into lmp-mr1-dev 2014-10-30 13:27:54 +00:00
Lorenzo Colitti
9a66159292 Enable 464xlat on wifi.
Bug: 12111730
Change-Id: If6d118a3c6e163262b09cc2fb3e3d3f9a81986ec
2014-10-30 20:31:27 +09:00
Lorenzo Colitti
8e8662929b Add support for running 464xlat on wifi as well.
1. Add a command to NetworkManagementService to enable/disable
   IPv6 ND offload via netd.
2. Make Nat464Xlat enable offload if clatd successfully comes up
   on a wifi network (which means it detected a NAT64), and
   correspondingly re-enable offload when the clatd interface
   goes down.

This change does not enable clatd on wifi yet, that requires an
extra 2 lines to enable it.

Bug: 12111730
Change-Id: I4318611762a37487c9a84f8c4867ec5aece98be8
2014-10-30 20:31:26 +09:00
Erik Kline
143e89c2f1 Treat optimistic addresses as global preferred.
If the kernel sends notification of an optimistic address then
treat is a useable address (isGlobalPreferred()).

Note that addresses flagged as IFA_F_OPTIMISTIC are
simultaneously flagged as IFA_F_TENTATIVE (when the tentative
state has cleared either DAD has succeeded or failed, and both
flags are cleared regardless).

Additionally: do not consider RFC 4193 ULA addresses sufficient
for "global preffered".  They are, by definition, of global scope
but not sufficient for global reachability.

Bug: 17769720
Change-Id: I759623b28fd52758f2d4d76d167f3cafd9319d6a
2014-10-29 19:11:58 +09:00
Lorenzo Colitti
67118eb4df Support more than one clatd at a time.
1. Make Nat464Xlat a per-network object, one for every network
   requiring clat, instead of a ConnectivityService singleton.
2. Make the NetworkManagementService clatd commands take an
   interface.
3. When we attempt to start clatd on a network, store its
   Nat464Xlat object in the NetworkAgentInfo, so we have an
   authoritative way of knowing whether clat is running on a
   given network.
4. Rework Nat464Xlat, hopefully simplifying it.

Bug: 12111730
Change-Id: I1fa5508ef020cd1c3d1c7a1f7b06370ac5fc2ae2
2014-10-29 01:23:26 +09:00
Erik Kline
a7691fcb44 Merge "(re)define the definition of "provisioned"" into lmp-mr1-dev 2014-10-28 07:53:37 +00:00
Lorenzo Colitti
846ae01231 Merge "Change removeStackedLink to take an interface name." into lmp-mr1-dev 2014-10-28 07:00:31 +00:00
Lorenzo Colitti
3825843c73 Change removeStackedLink to take an interface name.
This simplifies callers.

Also remove all "implementations" of addStackedLink and
removeStackedLink except the one in LinkProperties, because they
are unused.

Bug: 12111730
Change-Id: Ie294b855facba4b1436299dcb3211b72d9ba448e
2014-10-28 15:13:57 +09:00
Erik Kline
8b02307fd5 (re)define the definition of "provisioned"
Specifically:

    [1] provide a hasIPv4(), and
    [2] a hasIPv6()

each of which requires an IP address, a default route, and
address-family-specific DNS servers to evaluate to true.

Additionally:

    [3] redefine isProvisioned() to return the logical OR
        of [1] and [2] above.

Any external caller can still use any of the has*() methods to
construct its own, different definition of "provisioned".

Bug: 17769720
Change-Id: Ia692fb8508484ff403d3920c94d0e1db4563f807
2014-10-28 14:47:42 +09:00
Jeff Sharkey
c0e5d839a9 Follow API removal.
Bug: 18118003
Change-Id: Iad73ce748e05ba0660246e8dbb041415c187f792
2014-10-27 14:53:40 -07:00
Narayan Kamath
923d9a405c Merge "Deprecate more apache-http." into lmp-mr1-dev 2014-10-24 08:58:45 +00:00
Narayan Kamath
38c2dc3b49 Deprecate more apache-http.
bug: 18067888

Change-Id: I50511d53dfc9ae236dfb1646c55a5dd7fa15d7b2
2014-10-23 17:43:05 +01:00
Sreeram Ramachandran
76a545ffc4 Add an API to select a network for a DatagramSocket.
Mirrors the API that does this for Sockets.

Bug: 18076907
Change-Id: Ifa27b39e23797558546aab751fbfb3aed3b7dbcb
2014-10-23 08:37:33 -07:00
Lorenzo Colitti
31558633b3 am 28dcf034: Merge "Propagate network state changes to the LockdownVpnTracker." into lmp-dev
* commit '28dcf0345b2857884c1f1639fadb720318445187':
  Propagate network state changes to the LockdownVpnTracker.
2014-10-16 09:23:17 +00:00
Lorenzo Colitti
35495fadb1 Propagate network state changes to the LockdownVpnTracker.
Bug: 17695048
Change-Id: I10378df0ab545729a6a315fd1bc8870cd98f47b3
2014-10-16 01:16:50 +09:00
Robert Greenwalt
cd33c65aca am f393e491: Merge "Switch the NetworkInfo.mIsAvailable default" into lmp-dev
* commit 'f393e4910b42b2c9fd4dd6f970455649e00902e5':
  Switch the NetworkInfo.mIsAvailable default
2014-10-03 23:53:29 +00:00
Robert Greenwalt
458470fb16 Switch the NetworkInfo.mIsAvailable default
The placeholder for disconnected networks was setting it to false, but
this technically means that we know an attempt to connect to that
network will fail (which we don't really now).  Some applications use
this an decide not to bother trying - an MMS app for example would
never send an MMS because it thinks the network is never available.

This is a L regression.

bug:17669247
Change-Id: Id6041f226da069c267c56418d42c55978c36c66f
2014-10-03 16:05:36 -07:00
Robert Greenwalt
db4908dc1c am 707d0288: Merge "Send callbacks for Net property changes" into lmp-dev
* commit '707d028804d968bec423f0b8b2c007c4a82ff222':
  Send callbacks for Net property changes
2014-10-03 15:41:04 +00:00
Robert Greenwalt
707d028804 Merge "Send callbacks for Net property changes" into lmp-dev 2014-10-03 15:36:39 +00:00
Robert Greenwalt
e525a0a7f7 Send callbacks for Net property changes
LinkProperties and NetworkCapabilities changes were not calling app callbacks.

bug:17681483
Change-Id: I67dac3c4dc1284f5c4bfb24de239da4ec776336f
2014-10-02 21:05:44 -07:00
Paul Jensen
577d5005fc am b2a1ae10: Merge "Send updated NetworkAgent score to NetworkFactories when validated." into lmp-dev
* commit 'b2a1ae1042e6b40c1c8122ba77a96e06084068c0':
  Send updated NetworkAgent score to NetworkFactories when validated.
2014-10-03 02:22:25 +00:00
Paul Jensen
cdefb481da am a3c579e7: Merge "Allow any unvalidated Network to satisfy NetworkRequests." into lmp-dev
* commit 'a3c579e781de16edade627fedf76adb2ff2aaf3f':
  Allow any unvalidated Network to satisfy NetworkRequests.
2014-10-03 02:22:21 +00:00
Paul Jensen
b2a1ae1042 Merge "Send updated NetworkAgent score to NetworkFactories when validated." into lmp-dev 2014-10-03 02:18:12 +00:00
Paul Jensen
a3c579e781 Merge "Allow any unvalidated Network to satisfy NetworkRequests." into lmp-dev 2014-10-03 02:16:44 +00:00
Jason Monk
cd7cb4df35 am 51900639: Merge "Synchronize on all sendProxyBroadcast calls" into lmp-dev
* commit '519006395204ba3eab77ae420d20eb70ebb78af5':
  Synchronize on all sendProxyBroadcast calls
2014-10-02 22:42:58 +00:00
Jason Monk
e3a7ae6118 Synchronize on all sendProxyBroadcast calls
To avoid race conditions.  Also make mDefaultProxy volatile for
safety.

Bug: 17697364
Change-Id: I8f0abb1a6e1c816f3addc11a69ff794ad767f2cf
2014-10-02 15:39:38 -04:00
Paul Jensen
af94b9855b Send updated NetworkAgent score to NetworkFactories when validated.
Previously the score was not sent out causing other NetworkFactories
to have the lower unvalidated score and to repeatedly try to bring
up a new Network only to have it torn down.
Also, avoid logging an error when tearing down a network with only
listening requests.

bug:17726566
Change-Id: I82ff7c9bd5ec962f62a50ad0042c278622953969
2014-10-02 11:06:43 -04:00
Paul Jensen
0fa1abf72d Allow any unvalidated Network to satisfy NetworkRequests.
Explicitly selected Networks may never be validated (e.g. Chromecast)
but are still given a high score so they can explicitly become the
default Network.  Without this fix they do not become the default
Network if another Network is present.  This was an artifact of how
unvalidated Networks were handled, but now that unvalidated Networks
are properly handled, ala 50807d, we can freely rematch even
unvalidated Networks and NetworkRequests.
Also, never linger and teardown unvalidated Networks as the user
might be in the process of signing in.  This better matches prior
behavior when unvalidated networks didn't match NetworkRequests,
and thus were never lingered.
Also, don't disconnect networks that may be lingering.  The
disconnect logic in rematchNetworkAndReqeuests() is adjusted to only
fire when a network is newly validated.
It is incorrect to consider rematching uncreated Networks and
explicitly selecting created Networks, so this change logs error
messages in those cases.

bug:17647968
bug:17396616
Change-Id: Id6b8a350b8200f484d5bfd14ca0a8f64f08846a0
2014-10-02 10:56:51 -04:00
Sreeram Ramachandran
4da0928822 am 5aaabc0f: Merge "Send app permissions to netd." into lmp-dev
* commit '5aaabc0fa66dd755843f040fe634962477107950':
  Send app permissions to netd.
2014-10-02 06:29:37 +00:00
Sreeram Ramachandran
ae6c5079a5 Send app permissions to netd.
Based largely off Robert's http://ag/546170 (thanks!)

Bug: 15413737
Change-Id: I8a1f0a184923c4c0a4935e6b88895bcc05e39f02
2014-10-01 20:22:34 -07:00
Lorenzo Colitti
d58b52d695 am d4a26e96: Merge "Update LegacyTypeTracker state before sending connect broadcasts." into lmp-dev
* commit 'd4a26e96c2e7f53c5a4f842bd2d04b28242b6611':
  Update LegacyTypeTracker state before sending connect broadcasts.
2014-10-01 00:52:34 +00:00
Lorenzo Colitti
d4a26e96c2 Merge "Update LegacyTypeTracker state before sending connect broadcasts." into lmp-dev 2014-09-30 03:05:49 +00:00
Paul Jensen
72426b6194 am ebeaecde: Move mobile provisioning APN support into telephony.
* commit 'ebeaecde71b34ba32a2cc602c09e4822b8ecbf97':
  Move mobile provisioning APN support into telephony.
2014-09-29 20:47:32 +00:00
Paul Jensen
ebeaecde71 Move mobile provisioning APN support into telephony.
Most of this logic is simply removed from ConnectivityService.
The captive portal detection is now done by the NetworkMonitor.
The notification logic is still left in ConnectivityService as
it's used by both the NetworkMonitor and telephony's mobile
provisioning logic.

bug:17324098

Change-Id: Ibd1c42b1a75795f90a6483d3d0a5a14f88b193d8
2014-09-29 11:37:43 +00:00
Lorenzo Colitti
4b584064d2 Update LegacyTypeTracker state before sending connect broadcasts.
Currently, LegacyTypeTracker sends out connected broadcasts
before updating its internal lists of networks. This creates a
race condition where an app can query LegacyTypeTracker state
(e.g., via getActiveNetworkInfo) as soon as it gets the
broadcast, and get information that has not been updated.

Bug: 17540101
Change-Id: Iefd6d5e9fd0b427c5872166208831f70fcef8b6f
2014-09-29 20:15:33 +09:00
Lorenzo Colitti
fdd7f4e99a am 895b6726: Merge "Only stop/start clatd if necessary." into lmp-dev
* commit '895b6726e13611a614d245bbd4232f9f0449727f':
  Only stop/start clatd if necessary.
2014-09-24 01:29:44 +00:00
Lorenzo Colitti
6240ff578c am 6974f6a9: Merge "Block address families with routes, not NetworkAgent side channel" into lmp-dev
* commit '6974f6a97028a42ce79b8e9e1869af0ebf5624f4':
  Block address families with routes, not NetworkAgent side channel
2014-09-24 01:29:36 +00:00
Lorenzo Colitti
aa584b9631 Merge "Only stop/start clatd if necessary." into lmp-dev 2014-09-24 01:21:17 +00:00
Lorenzo Colitti
1ba96545b3 Merge "Block address families with routes, not NetworkAgent side channel" into lmp-dev 2014-09-24 01:21:06 +00:00
Lorenzo Colitti
cef8aecacf Only stop/start clatd if necessary.
Previously we would restart clatd on every LinkProperties
change, which now happens every time we switch radio technology
(e.g., LTE to HSPA). We also would not stop it if the link got
an IPv4 address.

Bug: 15024258
Bug: 17186694
Bug: 17569702
Change-Id: I65cfcd5e7acec8ea1a12392a59dabd668c58490f
2014-09-24 00:03:23 +09:00
Paul Jensen
f9e3dcf9e0 am 1c637c5f: Merge "Remove needless locking of mRulesLock that caused deadlocks." into lmp-dev
* commit '1c637c5fef678a82fd1f2c380d41ed6ebcb5bf2e':
  Remove needless locking of mRulesLock that caused deadlocks.
2014-09-23 12:08:22 +00:00
Paul Jensen
4a8196d434 Merge "Remove needless locking of mRulesLock that caused deadlocks." into lmp-dev 2014-09-23 12:00:35 +00:00
Lorenzo Colitti
885024dd7d am bb17a717: Merge changes I3ebf0cec,I8635472c into lmp-dev
* commit 'bb17a717750c558ece69344ecd93d96d4fbc4aca':
  Add a throw route to the VPN endpoint.
  Support non-unicast route types: unreachable and throw.
2014-09-23 03:21:21 +00:00
Lorenzo Colitti
83d12dbbb7 Block address families with routes, not NetworkAgent side channel
Now that we support unreachable routes, use those to block
address families on VPNs. This is a much more elegant solution.
Also update LinkProperties when IP addresses are added and
removed, fixing a TODO.

Bug: 17462989
Change-Id: Ib749d84710dca70d672350b9f129bb91419ec77e
2014-09-23 10:48:28 +09:00
Wink Saville
b0f0792383 Cleanup NetworkCapabilities.
Remove unused imports and variables.
Fix misspellings.
Added @Overrides.

Change-Id: I81f4adb0504e92d01c5465a0e14bc46d5ec3987e
2014-09-22 21:51:47 +00:00
Lorenzo Colitti
2129034e25 Support non-unicast route types: unreachable and throw.
Bug: 17462989
Change-Id: I8635472ca3e96ec2866af2de48e6260ab2da13fb
2014-09-22 13:10:15 +09:00