126 Commits

Author SHA1 Message Date
Robert Greenwalt
c9dac1185d Don't forget to turn off mobile_dun
When we find a higher priority match for tethering traffic we should turn off
whatever we were trying before.

bug:6083611
Change-Id: I06ee41336df107353bf1a979150345e461574a48
2012-02-29 14:02:55 -08:00
Chia-chi Yeh
5d134343ca am 1e9e7f76: am ff321d49: Merge "VPN: silence VPN notifications." into ics-mr1
* commit '1e9e7f76d5e6187befaf96eece258c27fd08bdc5':
  VPN: silence VPN notifications.
2012-01-12 14:30:44 -08:00
Chia-chi Yeh
50fe709995 VPN: silence VPN notifications.
Bug: 5852859
Change-Id: I269d8de298a1fd69a8d777150ae97927537a5424
2012-01-11 14:26:24 -08:00
Robert Greenwalt
32350c7ab2 Merge "Filter our v6 address from tethering dns." 2012-01-05 11:39:26 -08:00
Chia-chi Yeh
c1bac3a6e2 VPN: fix a CloseGuard warning.
Change-Id: Ic237a33038be9a170c1f9128332a8743c57971ed
2011-12-27 13:14:51 -08:00
Robert Greenwalt
4f74d552d5 Filter our v6 address from tethering dns.
Don't support IPv6 yet, and the tools crash when they see one, so
filter them out.

bug:5763980
Change-Id: Ie9a4445a3c72df3f7ab4320c507ebc8e8cd440ff
2011-12-20 14:47:22 -08:00
Robert Greenwalt
cc579b89fc Merge "Use the carrier-given dns addrs for tethering." 2011-12-12 14:02:02 -08:00
Chia-chi Yeh
2339fe3f8f am fa71962f: am 46a4e81d: Merge "VPN: delete the "abort" file before starting VPN daemons." into ics-mr1
* commit 'fa71962fe4595f484071ac0deb23f68d44932d83':
  VPN: delete the "abort" file before starting VPN daemons.
2011-12-12 13:15:34 -08:00
Robert Greenwalt
bb4fd0b444 Use the carrier-given dns addrs for tethering.
This fixes a complaint from carriers (that we used 8.8.8.8), but also
fixes the case where there is only room for one live radio
connection: the secondary connection (tethering) doesn't have a
default route to prevent on-device traffic from slipping out on the
tethering connection, but tethered dns is proxied through dnsmasq, so
it is appearing as on-device traffic and is unroutable.  By switching
to the carrier-indicated dns servers we can use the host-routes
already set for those and kill two bugs with one fix.

bug:5525764
bug:3045311
Change-Id: Ib1ccea81e0c0ed2d1462dc9721c2647124a790da
2011-12-09 17:12:03 -08:00
Chia-chi Yeh
c187273292 VPN: delete the "abort" file before starting VPN daemons.
Bug: 5714296
Change-Id: Idba41b9f3907747a84387ea4f3e930b3a185a06e
2011-12-08 16:51:41 -08:00
Jeff Sharkey
ddba10622d Clean up InterfaceConfiguration flags.
Offer modifier methods for interface flags instead of mutating
directly, and remove square brackets.

Change-Id: I4cce719dccedfb3f0e8448c111e65b93c0008cbb
2011-11-29 18:37:04 -08:00
Robert Greenwalt
fd1be2bc1e Tone down Tethering logs.
bug:5601582
Change-Id: I66c0a5a06a2c13a7cf93ea264d156b37df23745f
2011-11-11 14:09:45 -08:00
Robert Greenwalt
b445362bd6 Make upstream tether list threadsafe
Outsiders asking for this list may cause the list to change on another thread.
Fixing general synchronization issues.

bug:5531630
Change-Id: I7a3ee0bba3db40f45bcb0159491942fa4cf38c37
2011-11-07 14:44:48 -08:00
Robert Greenwalt
3b28e9a3da Start using IP tool for advanced routing.
bug:5495862
bug:5396842
Change-Id: I5e31b352b14a4dc746cacce4d61cf8d9ad7382a0
2011-11-04 09:52:04 -07:00
Robert Greenwalt
731026c2df Ignore errors when untethering
Sometimes the interface is removed before we can untether leading to
errors when cleanup up various rules (iptables).  Do as much as we can
and then let a re-tether result in error if needed.

bug:5536516
Change-Id: Ib1d064ecc8e9022566f9b0e4678b33144906971c
2011-11-02 13:53:28 -07:00
Robert Greenwalt
49348e77b6 Fix Tethering settings.
Two issues.  A mcc/mnc-driven overlay means that the config at boot may not be
the config we wish to use - the sim card is read later which may switch the
config.  Changed to read the configuration each time rather than once at boot.
Second, the secure-setting override was always trumping the resource config
as we weren't discriminating between a not-set default and a real setting.
This meant the config could never make DUN-required.

bug:5495862
Change-Id: Icd4e90ac1d32bbb704c0ff9cc69e954fb0a0b58c
2011-10-21 17:01:39 -07:00
Jeff Sharkey
367d15ab1a Watch network subtype, tethering teardown, empty.
Watch for changes to telephony network subtype, and update iface
mapping to persist stats under correct type.  Update network stats
before removing tethering NAT rules.

Skip recording that would create empty historical buckets.  Query UID
stats before iface stats to always skew positive when counters are
actively rolling forward.

Bug: 5360042, 5359860, 5335674, 5334448
Change-Id: I8aa37b568e8ffb70647218aa1aff5195d3e44d5a
2011-09-22 16:19:06 -07:00
Wink Saville
c9acde9aa6 Reduce connectivity logging
Change-Id: I5d45b8fbcd01e42df7f2b1cf02fb5b226128abb8
2011-09-21 11:05:43 -07:00
Jeff Sharkey
cdd02c5d76 Collect and persist tethering stats.
Use new "gettetherstats" netd command to retrieve statistics for
active tethering connections.  Keep tethering poll events separate
from UID poll, even though they end up same historical structures.

Bug: 5244846
Change-Id: Ia0c5165f6712c12b51586f86c331a2aad4ad6afb
2011-09-16 16:05:51 -07:00
Chia-chi Yeh
5317f034ba VPN: stop daemons by closing the control sockets.
As init now uses SIGKILL to stop daemons, performing graceful shutdown
becomes impossible. Here we implement our own solution by asking daemons
to monitor the control socket and terminate when it is closed.

Change-Id: I07a28807173a81b7f95e70f4193e974317acf88a
2011-08-22 13:09:49 -07:00
Chia-chi Yeh
0c074e6843 VPN: reset legacy VPN when resetting IPv4 addresses.
Currently legacy VPN only works on IPv4, and it should always
turn down when the addresses are changed. It assumed that the
interface will be brought down and up, so the event can be
detected via interfaceStatusChanged(). However, the assumption
was incorrect and the event is actually driver-dependent. To
fix this issue, ConnectivityService now tells VPN that the
interface is down when resetting IPv4 addresses.

Change-Id: I76d15e56552d86635c5b274ca980be5da905a6fb
2011-08-16 10:08:33 -07:00
Chia-chi Yeh
199ed6ef89 VPN: introduce VpnService as the base class for user space VPN.
Change-Id: I4793a6eb51b33f669fc6d39e1a16cf5eb9e3d851
2011-08-08 11:15:41 -07:00
Chia-chi Yeh
fcc1b41b66 VPN: move away from the VPN permission.
VpnBuilder will be replaced by VpnService in the next change.

Change-Id: I2dea67a1616b74d17b372f7b214d207f1617198e
2011-08-03 15:52:12 -07:00
Dianne Hackborn
6311d0a079 Clear the bitmap from the canvas in a lot of places.
Change-Id: I6b2071ac7b348c473b9bdd1b972d095aebbb4fb3
2011-08-02 16:37:58 -07:00
Robert Greenwalt
98c79e53c0 Stop sending tethering broadcasts during boot.
Well, actually they do go out, but they won't try to start anybody now
until after boot.

bug:5088272
Change-Id: Iaaf7a1e4b300e0afc3901ecfd225a77084bd0954
2011-07-28 11:51:11 -07:00
Mike Lockwood
485861c409 Fix USB tethering again
The kernel sends an interface down event for usb0 when RNDIS is enabled.
Ignore this and only remove USB interfaces when we receive the
interface removed event.

Change-Id: I1458f259b96c9fab4d3a69a5692e630123fad136
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-27 13:54:29 -04:00
Irfan Sheriff
e30c1307fb Merge "Handle hostapd and tether interface changes" 2011-07-23 22:30:36 -07:00
Irfan Sheriff
23eb297c77 Handle hostapd and tether interface changes
The set config will only update hostapd config file right now and we need to restart after that happens.

Also, softap interface is changed to be the regular interface

Bug: 5069108
Change-Id: Ibe80129b58e5339f06f186870bcd8f37569c6db3
2011-07-23 21:06:57 -07:00
Mike Lockwood
5db7af968a Merge "Fix USB tethering" 2011-07-23 19:36:32 -07:00
Mike Lockwood
6c2260b3af Fix USB tethering
The previous approach no longer works with the new USB drivers, since the usb0
interface is no longer enabled by default.
This introduced a chicken & egg problem - usb0 will not be enabled until the
user tries to start tethering, but Settings will not enable the checkbox unless
usb0 is enabled.
To fix this we add an explicit call to start USB tethering in the connectivity manager.
This will enable RNDIS if necessary and then bring up tethering once usb0 is enabled.

Change-Id: Iae1f733366aa6b0dafa66d4c97207794173ef54b
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-07-23 21:57:55 -04:00
Chia-chi Yeh
7ef8611b5f VPN: increase timeout period to 60 seconds for legacy VPN.
Some VPN needs more time than others in order to create the secure tunnel.
For example, L2TP/IPSec PSK on average needs 15 seconds on WiFi. On mobile
connection, variation gets larger, and it sometimes needs more than 30
seconds. This change increases timeout period from 30 to 60 seconds.

Change-Id: I6006fd254a7bc91c22f63d2f3f20ea79ee9b05e2
2011-07-22 15:46:52 -07:00
JP Abgrall
b6055fe747 Merge "NetworkManagementService: receive bandwidth controller events" 2011-07-21 18:44:52 -07:00
Chia-chi Yeh
aa1727fe0c VPN: tear down VPN when the dependent interface is down.
Change-Id: I1eaf8e39ee7aed1f4ecbd4c36c2a81a68ad2f9d1
2011-07-14 19:01:40 -07:00
JP Abgrall
12b933d0d9 NetworkManagementService: receive bandwidth controller events
This is a 1st pass at receiving events that indicate
some quota has been reached e.g. warning quota, data collection quota,
 cutoff quota,...

It needs:
  - new kernel with quota2 logging support
  - new net:bandwidthcontroller that supports
    . quota2,
    . setting alerts.
  - new NetlinkEvent/NetlinkManager/NetlinkHandler to process
     NETLINK NFLOG messages.

Change-Id: Ibfbb13512c5350cdee0e544ec14caa6f59812409
2011-07-14 18:09:22 -07:00
Chia-chi Yeh
5779c9c2d9 VPN: close the socket in protectVpn() to avoid leaking descriptors.
Change-Id: Idda0c2ea1770abc490566e894711bcb08f60b354
2011-07-14 16:19:19 -07:00
Chia-chi Yeh
97a61565ea VPN: Hook up the new control protocol and network state.
1. No more End-Of-Arguments.
2. Daemons close the control socket after they are initialized.
3. No more system properties.
4. ip-up-vpn now creates state to pass the configuration.
5. JNI methods are split again for legacy VPN.

Change-Id: I02fafdf01d425c965345ef712b2bd5fdee3a0cab
2011-07-14 15:07:42 -07:00
Robert Greenwalt
7c34f29c8a Fix wifi tethering.
The new link-status netlink monitor is a bit chatty and we were getting race conditions.
The wl0.1 soft-ap interface was getting created, but in the off state.  We would report
it available (link-added always reports it) causing wifi to start tethering, but then
we'd sometimes get a link-status-down notification and a link-status-up, causing wifi
to freak out with these two requests.

The simple fix was to not listen to the new link-status notifications.  This should be
redesigned in the future.
bug:4983942

Change-Id: Ica4f34d8bf2a07fc19b35a1e15283a7f8022165e
2011-07-11 15:24:43 -07:00
Chia-chi Yeh
2e46764a70 VPN: implement status report for legacy VPN.
Change-Id: I81c28dafd9588572df76cbc303b0d6a0f41f9bc6
2011-07-04 03:23:12 -07:00
Chia-chi Yeh
c2b8aa0b4c VPN: rename some variables.
Change-Id: I7f15b5ab30f591e26242fca27af25f578809534c
2011-07-03 18:00:47 -07:00
Chia-chi Yeh
100155a310 VPN: convert prepare() into a form which helps solve race conditions.
When someone tries to revoke packageA, it is possible that packageA is
already revoked by packageB. In this case packageB should not be revoked,
and the new prepare() can help solve this problem.

Change-Id: Iee056a191dd99467b8ad1b5379a17b02d404bad1
2011-07-03 17:03:27 -07:00
Chia-chi Yeh
34e7813e96 VPN: minor refinement.
Change-Id: I2b59cbe8554b6c6f8da48c465252489394f32653
2011-07-03 03:07:07 -07:00
Chia-chi Yeh
3281034c1c VPN: merge JNI methods.
Legacy VPN needs to change routes by itself.

Change-Id: I4cf6639f2b00225810f49704ae05797fc70921d9
2011-07-02 16:16:03 -07:00
Chia-chi Yeh
e9107901ae VPN: give legacy VPN a fake package name.
And add more comments.

Change-Id: I0cbc495fcb2c8dd105e16a841619b3b9bd227eae
2011-07-02 01:48:50 -07:00
Chia-chi Yeh
41d1685a22 VPN: integrate legacy VPN.
Change-Id: I00e77664354c05e0edfcd5fb2e3da2ca434ed521
2011-07-01 02:12:06 -07:00
Chia-chi Yeh
8909b10175 VPN: Use List<String> instead for dnsServers and searchDomains.
Change-Id: I5d72c182ad47f59121a04b68ec6c2d164e2d00a8
2011-07-01 01:14:19 -07:00
Chia-chi Yeh
1f7746b39b VPN: rename service(s) to daemon(s) to reduce confusion.
Change-Id: I9739e63c8e41e8b63d024dc4f17283c76bb4ff97
2011-07-01 00:29:06 -07:00
Chia-chi Yeh
383e052472 VPN: fix the build.
Change-Id: Ibeaa067cf95636e09746d16f402c78c99d7cb681
2011-07-01 00:13:25 -07:00
Chia-chi Yeh
a4b87b5e98 VPN: refactor a little bit for the upcoming integration of legacy VPN.
Change-Id: I0fe0dffe59d8d9c9a0fdd05e07b07aa6c8da0a80
2011-06-30 23:21:55 -07:00
Chia-chi Yeh
f4e3bf892e VPN: refactor few JNI methods for the usage of legacy VPN.
Now default routes are handled in JNI instead of VpnBuilder.

Change-Id: Ib026bba6793b64aae0f8356df3d2aaae489d08b4
2011-06-30 12:41:11 -07:00
Chia-chi Yeh
85a7ce02c8 VPN: add a method to handle requests of legacy VPNs.
The code is working but not complete yet.

Change-Id: Id8c8f137665373ad52c626b9d34e5a2cad028597
2011-06-29 16:05:58 -07:00