History log of /system/netd/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
12a76036b51139338e4329b0d7ec79bbc84e9580 01-Sep-2015 Lorenzo Colitti <lorenzo@google.com> Don't break IPv6 connectivity when in doze mode.

Working IPv6 connectivity relies on the kernel being able to
receive certain ICMPv6 packets (router advertisements, neighbour
solicitations, neighbour advertisements) at all times. Allow
these packets when in doze mode.

This is not necessary for IPv4 because in IPv4 these functions
use ARP, which is invisible to iptables.

Bug: 23158230
Change-Id: I29ed77561db9688486cf58cd14ac3bce7fce4b40
erver/FirewallController.cpp
erver/FirewallController.h
f2fed7647ede2ae39a76d50cf4abc9e57b49d40d 19-Aug-2015 Yusuke Sato <yusukes@google.com> Make iptables -L and -S calls wait for xtables lock

(cherry picked from commit 99b40503edccae74d0917b9d1e17a5939ac7193b)

Bug:22802665
Change-Id: Ief59212ab976af940887508fab706b5be07005c6
erver/BandwidthController.cpp
f86df5580e86c2405c71c708408eeee57b38c0d3 18-Aug-2015 Stephen Hines <srhines@google.com> Move local union such that it doesn't escape (and get optimized out).

Bug: 23239997

The Clang update exposed a latent bug in the code here, where a pointer
to a local variable escaped the encapsulating block. Clang noticed the
end of this object's lifetime, and removed assignments to its original
storage (because they are now dead assignments). By moving the union out
of the block, it will survive until the sendmsg() call, and the expected
writes will be restored.

Change-Id: If2106d2f53d761ddca6dd26ab2648244d737dcd9
lient/FwmarkClient.cpp
451ca998f1eed36d5fefb5593ed43605c4d6c0bd 04-Aug-2015 Paul Jensen <pauljensen@google.com> Merge "Make netd calls to iptables wait for xtables lock" into mnc-dev
94b2ab92f6e886d24092781159714be75c9f3954 04-Aug-2015 Paul Jensen <pauljensen@google.com> Make netd calls to iptables wait for xtables lock

Without this wait iptables commands can fail with various unpleasant
consequences like Log.wtf() or missing iptables rules. The most
critical calls to iptables in NetdConstants.cpp already wait for the
lock.

Bug:22802665
Change-Id: I7d542c3d4f0e005618e368da674159b90d652c8a
erver/BandwidthController.cpp
erver/IdletimerController.cpp
erver/NatController.cpp
erver/oem_iptables_hook.cpp
7adf8d71b80a729354c358d7a0110651750db5f2 28-Jul-2015 Erik Kline <ek@google.com> Enable use_oif_addrs_only in netd.

Bug: 19470192
Bug: 21832279
Bug: 22464419
Change-Id: I53a9e592a03fd16c124dcae2a47c6ac2e9049c48
erver/InterfaceController.cpp
cea2d3455eb7c0d9ad1430607cbe98cc09251c1f 25-Jun-2015 Erik Kline <ek@google.com> Use struct android_net_context when interfacing with bionic

Add a new NetworkController::getNetworkContext() that builds the
contents of a struct net_context out of getNetworkForConnect()
and getNetworkForDns().

Bug: 19470192
Bug: 20733156
Bug: 21832279
Change-Id: I5a69b0413a83d33be28b78c0a99359b109517a8f
erver/DnsProxyListener.cpp
erver/DnsProxyListener.h
erver/NetworkController.cpp
erver/NetworkController.h
feb2b61d3010d52e530357116c3b22c6d77da3cf 26-Jun-2015 Xiaohui Chen <xiaohuic@google.com> netd: add default fw white list for system uids

In uid firewall white list, we white list the system uid range
by default to make sure system processes will always have network
access.

BUG:22094135
Change-Id: I8f472a98a9fd93591a2887982cec1458d7683613
erver/FirewallController.cpp
1cdfa9adfa584029cb6d9ac13a2896786001b3a1 09-Jun-2015 Xiaohui Chen <xiaohuic@google.com> netd: add two child chains to firewall

This is an attempt to speed up getting out of device idle. It groups
uid firewall rules in these child chains so we can attach/detach a whole
chain instead of individual uid rules.

BUG:21446713
Change-Id: I61dc7d14110e633c5994e466481b9cac633a7a4f
erver/CommandListener.cpp
erver/CommandListener.h
erver/FirewallController.cpp
erver/FirewallController.h
3f95777d2aafa6c0ac4671d55557cad0d04a223f 03-Jun-2015 Erik Kline <ek@google.com> Fix boolean to integer return value conversion.

Change-Id: Ie996c9b4f84f9cd8395abb592ecf0c04cfdc4023
erver/InterfaceController.cpp
fef7e149224681ba49bc39856c25610bb04c3735 13-May-2015 Erik Kline <ek@google.com> Merge "InterfaceController::setBaseReachableTimeMs()" into mnc-dev
660064bc50ce27913594399dece629254b00ad49 13-May-2015 Erik Kline <ek@google.com> Merge "Partial refactoring and Android-type style changes." into mnc-dev
145fd25509e08fb2d76fcff8d011e1aa9a2e6455 12-May-2015 Erik Kline <ek@google.com> InterfaceController::setBaseReachableTimeMs()

Add an InterfaceController::setBaseReachableTimeMs() method to set
the ARP/ND default reachable time, as configured in:

/proc/sys/net/ipv4/{interface}/base_reachable_time_ms
/proc/sys/net/ipv6/{interface}/base_reachable_time_ms

Bug: 18581716
Change-Id: Idc652e81396d81efe0f08bb1d6dc38bc8e554a56
erver/InterfaceController.cpp
erver/InterfaceController.h
e1da484b30196cc6ec496407e32c67bcb5295bec 12-May-2015 Erik Kline <ek@google.com> Partial refactoring and Android-type style changes.

Bug: 18581716
Change-Id: I85aec575a318861468ea4707b70ed747c27293c7
erver/InterfaceController.cpp
erver/InterfaceController.h
d1df597001aadd5d83c9a3d1fe8bbde2bc9256ca 06-May-2015 Paul Jensen <pauljensen@google.com> Add FwmarkServer support for querying whether a UID can access a NetID

This new FwmarkServer API is only accessible from system apps.

Bug:20470604
Change-Id: Ie2376cdddc10f658fcc5802ef3e8dc9f1948d5c0
lient/FwmarkClient.cpp
lient/FwmarkClient.h
lient/NetdClient.cpp
nclude/FwmarkCommand.h
nclude/NetdClient.h
erver/FwmarkServer.cpp
390e4ea8106f9e741bc80fb962aaee94d5b28cbb 26-Apr-2015 Amith Yamasani <yamasani@google.com> Blacklist uids for network access

FirewallController can now be in blacklist mode (aka disabled)
or whitelist mode (aka enabled).

Some of the methods don't do anything when in blacklist mode.

Uid rules updated to allow dropping packets to uids that
shouldn't get any network access, usually for idle apps.

Added a wait option to iptables calls to make sure it doesn't
fail if there's contention. Fixes a flakiness I was seeing in
removing rules.

Bug: 20066058
Change-Id: I815bcb45aa06d04020e902df8c67bb3894e98f40
erver/CommandListener.cpp
erver/CommandListener.h
erver/FirewallController.cpp
erver/FirewallController.h
erver/NetdConstants.cpp
52e673f59eecf3e24b3b257bec0f977da5c35325 23-Apr-2015 Ruchi Kandoi <kandoiruchi@google.com> netd: Adds support for uid in idletimer netlink notification.

Change-Id: Ib85b85fc12b20436e0d788d5c3ec66306c632b57
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
Bug: 20264396
(cherry picked from commit 05c39f0a048abf6b8a44f17063f0c1f8c16285ed)
erver/NetlinkHandler.cpp
erver/NetlinkHandler.h
a59c928252869242642edfed689902a488a6298f 01-Apr-2015 Erik Kline <ek@google.com> Corrently log /set/ MTU error.

Change-Id: I90e2d4f64a5c3ec9f640fd7dc41438517110cf68
erver/CommandListener.cpp
42d41d5d43bf99d939ee1d66645cea836241201c 27-Mar-2015 Dan Albert <danalbert@google.com> Remove uses of libcxx.mk.

This is a no-op.

Change-Id: Ic9d3070b7c329d9744ed660e426c5f39704ffccc
lient/Android.mk
erver/Android.mk
47146d0a8a29c6fefb2bc9a5fa399e6666620eeb 16-Mar-2015 Dan Albert <danalbert@google.com> am 200e0b53: (-s ours) Merge "Revert "Revert "Update for libbase."""

* commit '200e0b53817227453418a432b1384792c1bc29da':
Revert "Revert "Update for libbase.""
bcf4439897a25022d98860484df38dacdc702ee1 16-Mar-2015 Dan Albert <danalbert@google.com> Merge "Revert "Revert "Update for libbase."""
200e0b53817227453418a432b1384792c1bc29da 16-Mar-2015 Dan Albert <danalbert@google.com> Merge "Revert "Revert "Update for libbase."""
5407e14fd3d81bb76f94221b4a359faa2806de65 16-Mar-2015 Dan Albert <danalbert@google.com> Revert "Revert "Update for libbase.""

This reverts commit 4a0ab5ff4a87cfc4a987da99546b01e44875a2e5.

(cherry picked from commit 3e87c785434fdfed2fb00496cb391c411a426bdd)

Change-Id: I042f485f3cc84206766298853491ddd26dbba13f
erver/Android.mk
erver/InterfaceController.cpp
erver/RouteController.cpp
erver/SoftapController.cpp
erver/TetherController.cpp
f503e130eb9b3592dc1d2755fd169d73df0e79d0 16-Mar-2015 Dan Albert <danalbert@google.com> Revert "Revert "Update for libbase.""

This reverts commit 4a0ab5ff4a87cfc4a987da99546b01e44875a2e5.

Change-Id: Idd2947bbdaef267ffd68179b4d3fe267870b9de4
erver/Android.mk
erver/InterfaceController.cpp
erver/RouteController.cpp
erver/SoftapController.cpp
erver/TetherController.cpp
0bad1be08c2eac24231baab2a743b49024032629 16-Mar-2015 Dan Albert <danalbert@google.com> Revert "Revert "Update for libbase.""

This reverts commit 4a0ab5ff4a87cfc4a987da99546b01e44875a2e5.
erver/Android.mk
erver/InterfaceController.cpp
erver/RouteController.cpp
erver/SoftapController.cpp
erver/TetherController.cpp
afd4037d7d7802d2ecc0494901ac17134a27aa1f 16-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> Forgot this in merge resolution.

Change-Id: Ieb26ec5fc333743b86d414ee558c978334647853
erver/DummyNetwork.cpp
erver/TetherController.cpp
e298ded6ade9744f2a79cae045b5c324886262f4 16-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> resolved conflicts for merge of 6066d418 to master

Change-Id: I2aa9721365e96c363648dd8e9e15718ed50e3c12
6066d41889ada93c5312e081d5bdff94fc1fd2af 16-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> Merge "Revert "Update for libbase.""
4a0ab5ff4a87cfc4a987da99546b01e44875a2e5 16-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Update for libbase."

Breaks internal master.

This reverts commit b67219a71d1d896bcb34c4a7a797824b88515b2c.

Change-Id: I43145f0724ad2d669b65d20b6fd6ccc44b8f0a4f
erver/Android.mk
erver/InterfaceController.cpp
erver/RouteController.cpp
erver/SoftapController.cpp
erver/TetherController.cpp
a4614fe5bfaafd0ff6be60ddb6fd135f99f5a5a5 16-Mar-2015 Vinit Deshpande <vinitd@google.com> Merge remote-tracking branch 'goog/mirror-m-wireless-internal-release'

Change-Id: I51337014e2851f47dd5e183c4bfdf39bafa59942
6d631575749406ad4d69ce14f59910bf5f186deb 15-Mar-2015 Dan Albert <danalbert@google.com> am e3734499: Merge "Update for libbase."

* commit 'e37344992f49c8e0e6e9b816f590afbd00a961ca':
Update for libbase.
e37344992f49c8e0e6e9b816f590afbd00a961ca 15-Mar-2015 Dan Albert <danalbert@google.com> Merge "Update for libbase."
b67219a71d1d896bcb34c4a7a797824b88515b2c 14-Mar-2015 Dan Albert <danalbert@google.com> Update for libbase.

StringPrintf and the string based file I/O are being moved to libbase.

Change-Id: I765d9e53f65a76d318d9d0d9503403fc092254d5
erver/Android.mk
erver/InterfaceController.cpp
erver/RouteController.cpp
erver/SoftapController.cpp
erver/TetherController.cpp
32fa9ba006ce62737cdcc48b9df2b2f4a432d5e1 13-Mar-2015 Jeff Sharkey <jsharkey@android.com> Follow NetlinkEvent refactoring.

Change-Id: Ibb6101c8741f862f4732fb200f646dfd329f4782
ndroid.mk
erver/NetlinkHandler.cpp
erver/NetlinkHandler.h
8656c84dcab2800fd7c1d64bba307527619d7bdb 10-Mar-2015 Vinit Deshpande <vinitd@google.com> am "Parse all netids with stringToNetId."

merged from partner/m-wireless-wifi-dev
6c65afd Parse all netids with stringToNetId.
3d11f32264690462e708ccbbce3bb34b64760465 10-Mar-2015 Vinit Deshpande <vinitd@google.com> am "server: softap: Set hw_mode according to selected channel [DO NOT MERGE]"

merged from partner/m-wireless-wifi-dev
2f8e725 server: softap: Set hw_mode according to selected channel [DO NOT MERGE]
7592d7a78be3cf29f2eaee56f5be11f37db15c82 10-Mar-2015 Vinit Deshpande <vinitd@google.com> am "set softAP on a specified band, including both 2.4 and 5 GHz band"

merged from partner/m-wireless-wifi-dev
1ecc6c9 set softAP on a specified band, including both 2.4 and 5 GHz band
6b6f25fa4c135d477bcaf0bb50305a5d9aee92e3 03-Mar-2015 Lorenzo Colitti <lorenzo@google.com> Flush tethering rules on interface remove.

Bug: 19500693
Change-Id: I25b7942784ec026d30c60273c9e13e34d082d25a
erver/RouteController.cpp
57947f02c00bb03651e3f9427c880211c689db7f 27-Feb-2015 Lorenzo Colitti <lorenzo@google.com> Add oif rules that allow UID 0 to bypass the VPN.

This is needed for wifi calling so that the kernel (which does
not set marks) can tee packets towards the modem. It also fixes
things like not being able to reply to DHCP requests from
tethered clients when a VPN is up.

System apps can already bypass the VPN using explicit marks, so
allowing UID 0 to do so does not create additional bypass VPN
issues.

Bug: 19500693
Change-Id: Ie324026893637e9bd8e7aa65a37579569390e7b7
erver/RouteController.cpp
32d768792bcd5860512998543f6904d91da1a9b7 25-Feb-2015 Lorenzo Colitti <lorenzo@google.com> Separate NAT from forwarding.

Bug: 19500693

Change-Id: Ib3871106ea3c0d68327611e7568c0710210e4ff2
erver/CommandListener.cpp
erver/NatController.cpp
5ad4e98f7b566ffde39491ee4e80d4a15507f053 26-Feb-2015 Lorenzo Colitti <lorenzo@google.com> Make the VPN rule only to originated, not forwarded, traffic.

Currently the VPN rule for the primary user will match every
forwarded packet on the system, because it specifies a UID range
that includes 0, and forwarded packets have UID 0.

Use "iif lo" to limit the rule match to locally-originated
traffic. This requires a kernel that sets the loopback ifindex.
when originating packets. Anything based on 3.10 is fine, but
devices using 3.4 will need a one-line change for IPv6.

Bug: 19500693
Change-Id: Iaab88bed62716dc1cea33b45c4e258f6b3bfc9d0
erver/RouteController.cpp
3667936aadcabddc708797ac38ce1ffb2f992cb3 25-Feb-2015 Lorenzo Colitti <lorenzo@google.com> Add a dummy network that discards all packets.

Bug: 19500693
Change-Id: Ic25f2d8c481f1528e887e43ca3fa868189582110
erver/Android.mk
erver/DummyNetwork.cpp
erver/DummyNetwork.h
erver/Network.h
erver/NetworkController.cpp
erver/NetworkController.h
erver/RouteController.cpp
799625cd5b0a2191632f5b042bf9ff559c18a848 24-Feb-2015 Lorenzo Colitti <lorenzo@google.com> Changes to forwarding for wifi calling.

1. Support multiple forwarding requests. Keep track of all
requests inside TetherController, and enable system
forwarding any time there is more than one active request.
2. Enable both IPv4 and IPv6 forwarding.

Bug: 19500693
Change-Id: Ic81bae7b399bc6ebf6a63de4bcd341885638dfa4
erver/CommandListener.cpp
erver/TetherController.cpp
erver/TetherController.h
6b0ad646613964d25720196b64f9c8a9aa83b846 12-Feb-2015 Alex Klyubin <klyubin@google.com> am 909757cf: am 7a269cb3: Merge "Store MARK/CONNMARK flags in a central location."

* commit '909757cfc276546652d8f6d433c56d644325af8c':
Store MARK/CONNMARK flags in a central location.
4674fae60573cf2ac43c4a3f8388853a3172510c 12-Feb-2015 Elliott Hughes <enh@google.com> resolved conflicts for merge of 64b816ba to master

Change-Id: Ie6348e38e90e48ffe115e63e5fde16640e2c3d92
909757cfc276546652d8f6d433c56d644325af8c 12-Feb-2015 Alex Klyubin <klyubin@google.com> am 7a269cb3: Merge "Store MARK/CONNMARK flags in a central location."

* commit '7a269cb3916692b691c7f3a531f3eba78be7a366':
Store MARK/CONNMARK flags in a central location.
7a269cb3916692b691c7f3a531f3eba78be7a366 12-Feb-2015 Alex Klyubin <klyubin@google.com> Merge "Store MARK/CONNMARK flags in a central location."
64b816bafcb735dd06f4ddf233ba2bad8fd08f47 04-Feb-2015 Elliott Hughes <enh@google.com> am f48d6abf: Merge "Switch writing to <utils/file.h>."

* commit 'f48d6abfb701cedbf619fb530e69a4a245ad0697':
Switch writing to <utils/file.h>.
f48d6abfb701cedbf619fb530e69a4a245ad0697 04-Feb-2015 Elliott Hughes <enh@google.com> Merge "Switch writing to <utils/file.h>."
bd37832f1843ed78f64604e5627cf952ac9614ba 04-Feb-2015 Elliott Hughes <enh@google.com> Switch writing to <utils/file.h>.

Change-Id: Idb2de24414f4dd8e926e625b62e4d12152dc4527
erver/RouteController.cpp
erver/SoftapController.cpp
564f2305c6b7481433c2a06978625b38fb0a1ed2 04-Feb-2015 Elliott Hughes <enh@google.com> am a0b6b3a6: am 50c6639a: Merge "Use StringPrintf."

* commit 'a0b6b3a6ec2090ebd6cae611ec35fc670857331b':
Use StringPrintf.
a0b6b3a6ec2090ebd6cae611ec35fc670857331b 04-Feb-2015 Elliott Hughes <enh@google.com> am 50c6639a: Merge "Use StringPrintf."

* commit '50c6639a55b3208b64adc691b181a90e1e6de223':
Use StringPrintf.
50c6639a55b3208b64adc691b181a90e1e6de223 04-Feb-2015 Elliott Hughes <enh@google.com> Merge "Use StringPrintf."
be95c1599783ffd4cf0661db263c2e6783e27d6e 04-Feb-2015 Elliott Hughes <enh@google.com> Use StringPrintf.

This doesn't replace every asprintf in netd, but it replaces the ones in code
I touched.

Change-Id: I2de5c7772523372bb36145e66e885aa8132ad58e
erver/InterfaceController.cpp
1e05c8b6be8f6ff5771bd18f28ece90015c052ff 03-Feb-2015 Elliott Hughes <enh@google.com> am 561ad8c1: resolved conflicts for merge of c9692899 to lmp-mr1-dev-plus-aosp

* commit '561ad8c1a4fd519a6ae632ea1d414f90e62da95f':
Switch netd over to <utils/file.h>.
fa18636462a4a3b32c68cd435108259fdc928687 03-Feb-2015 Nick Kralevich <nnk@google.com> am 69766c22: am 6c08cd6a: Merge "Avoid leaking file descriptors"

* commit '69766c22edb99338c3b703aeadbaa286f6b78334':
Avoid leaking file descriptors
561ad8c1a4fd519a6ae632ea1d414f90e62da95f 03-Feb-2015 Elliott Hughes <enh@google.com> resolved conflicts for merge of c9692899 to lmp-mr1-dev-plus-aosp

Change-Id: I8f4c9ae0d13d30e69b7a197eafdfcb9b2b9050c0
69766c22edb99338c3b703aeadbaa286f6b78334 03-Feb-2015 Nick Kralevich <nnk@google.com> am 6c08cd6a: Merge "Avoid leaking file descriptors"

* commit '6c08cd6aa7aee66b973ee4861237ad36560e0239':
Avoid leaking file descriptors
c9692899c936d2d45f9c52f94b9847bd9de86bae 03-Feb-2015 Elliott Hughes <enh@google.com> Merge "Switch netd over to <utils/file.h>."
d161406141619f84d94b2ecee618569cbbabcb30 03-Feb-2015 Elliott Hughes <enh@google.com> Switch netd over to <utils/file.h>.

Change-Id: Id79961cc4feee1c307dad06d64e3f4ffe060c4da
erver/Android.mk
erver/InterfaceController.cpp
erver/NetdConstants.cpp
erver/NetdConstants.h
erver/TetherController.cpp
fe9099834f313a0aa2b7cca9a322441e8152add4 02-Feb-2015 Alex Klyubin <klyubin@google.com> Store MARK/CONNMARK flags in a central location.

MARK/CONNMARK values/tags are shared accross all controllers because
of the way the firewall works. To avoid accidental clashes, it's best
to store the values used in a central place.

Change-Id: I76aaba38cba6554704a5635b1e7297a144e6e2ff
erver/ConnmarkFlags.h
erver/StrictController.cpp
6c08cd6aa7aee66b973ee4861237ad36560e0239 31-Jan-2015 Nick Kralevich <nnk@google.com> Merge "Avoid leaking file descriptors"
53ea9cadf6cc5f8be1c16b5b6b660cd7366fd3f0 31-Jan-2015 Nick Kralevich <nnk@google.com> Avoid leaking file descriptors

Add O_CLOEXEC on open() calls, and SOCK_CLOEXEC on socket calls.
This avoids leaking file descriptors across execs.

Addresses the following SELinux denial:

audit(1422740213.283:8): avc: denied { read write } for pid=2597 comm="clatd" path="socket:[6709]" dev="sockfs" ino=6709 scontext=u:r:clatd:s0 tcontext=u:r:netd:s0 tclass=netlink_socket

and allows the removal of some other SELinux rules which were
inappropriately added because of leaking file descriptors.

Change-Id: I9c180488ea1969d610e488f967a7276a672bb477
lient/FwmarkClient.cpp
lient/NetdClient.cpp
erver/BandwidthController.cpp
erver/NetdConstants.cpp
erver/NetlinkManager.cpp
erver/RouteController.cpp
erver/SoftapController.cpp
erver/TetherController.cpp
f0bb70c000e6fd85c3289e957c0a66b2bed1df3c 29-Jan-2015 Lorenzo Colitti <lorenzo@google.com> am 623e69e6: am aea68fdd: Merge "Don\'t fail when trying to add routes that already exist."

* commit '623e69e66b18fb3af840369633548bbd6c098580':
Don't fail when trying to add routes that already exist.
623e69e66b18fb3af840369633548bbd6c098580 29-Jan-2015 Lorenzo Colitti <lorenzo@google.com> am aea68fdd: Merge "Don\'t fail when trying to add routes that already exist."

* commit 'aea68fddd979bf6852b8aef9bc718567f9da935a':
Don't fail when trying to add routes that already exist.
aea68fddd979bf6852b8aef9bc718567f9da935a 29-Jan-2015 Lorenzo Colitti <lorenzo@google.com> Merge "Don't fail when trying to add routes that already exist."
0321315d4e94dacd5ef2e0de217059cbc72d803d 30-Oct-2014 Sreeram Ramachandran <sreeram@google.com> Don't fail when trying to add routes that already exist.

Previously, we suppressed failures for the special case of
requestRouteToHost() being called multiple times. Turns out that other
parts of the system also try to add duplicate routes, so just suppress
EEXIST errors in general (as far as adding routes is concerned). For
example, this happens when the WiFi P2P DHCP client renews its lease
and blindly requests to add a route that it had already added before.

(cherry picked from commit 64166e7666e3cc7f4b9c715f2b4e19d28ae44c5a)

Bug: 17205769
Change-Id: I11d50052f616cb48a912d647b8024ccef01b736d
erver/RouteController.cpp
1ed73bbc4330728aaf69a42a1838d4532cfb38c1 28-Jan-2015 Elliott Hughes <enh@google.com> am 29cbbf2a: am b1842acd: Merge "Add missing <string.h> include."

* commit '29cbbf2a37ceb841c20004189bac2bc2895aff2f':
Add missing <string.h> include.
4ee4634a11a65ecd4e490ce32a54b47d82f77d56 28-Jan-2015 Elliott Hughes <enh@google.com> am 750f9d0a: am 883d129b: Merge "Add missing <malloc.h> include."

* commit '750f9d0abe7d3f06b7a2f8dcfee780fd956023d4':
Add missing <malloc.h> include.
29cbbf2a37ceb841c20004189bac2bc2895aff2f 28-Jan-2015 Elliott Hughes <enh@google.com> am b1842acd: Merge "Add missing <string.h> include."

* commit 'b1842acd6fcba8a1d80efd95ea3e88c2faf7eeb0':
Add missing <string.h> include.
750f9d0abe7d3f06b7a2f8dcfee780fd956023d4 28-Jan-2015 Elliott Hughes <enh@google.com> am 883d129b: Merge "Add missing <malloc.h> include."

* commit '883d129ba24bfc599b65b09fd0b5aaa0946d1958':
Add missing <malloc.h> include.
b1842acd6fcba8a1d80efd95ea3e88c2faf7eeb0 28-Jan-2015 Elliott Hughes <enh@google.com> Merge "Add missing <string.h> include."
883d129ba24bfc599b65b09fd0b5aaa0946d1958 28-Jan-2015 Elliott Hughes <enh@google.com> Merge "Add missing <malloc.h> include."
5f4938fea4170d251a3eb23ffc6239cfd1604cc8 28-Jan-2015 Elliott Hughes <enh@google.com> Add missing <malloc.h> include.

Change-Id: I0259da35f2dc8ff87c928eb5bd378f39cbfc9f9c
erver/InterfaceController.cpp
bb881e28e62bc5048f4a62d21104aa25da13b0f1 28-Jan-2015 Elliott Hughes <enh@google.com> Add missing <string.h> include.

Change-Id: I14ea45e98b8271d6b53ac86e92ad3b5c7dac8f75
lient/FwmarkClient.cpp
6c65afddc22abb87b7c531f283bde42c7e1b7a48 20-Jan-2015 Erik Kline <ek@google.com> Parse all netids with stringToNetId.

Bug: 19049156
Change-Id: Iaa3b1a84afa469dfbc0cd0798271467528196c9d
erver/CommandListener.cpp
9adc9f32a45d19b34b5b4c4be7a20396c7e20c22 20-Jan-2015 Erik Kline <ek@google.com> Parse all netids with stringToNetId.

Bug: 19049156
Change-Id: Iaa3b1a84afa469dfbc0cd0798271467528196c9d
erver/CommandListener.cpp
5e0d8f78385ddae22089a777dc858420af4bc829 23-Jan-2015 Jeff Sharkey <jsharkey@android.com> am 51f7a8ee: am 6ef96c48: Merge "Config NFLOG target before listening."

* commit '51f7a8ee6eb051b939bd02bf82a399da676bf32f':
Config NFLOG target before listening.
51f7a8ee6eb051b939bd02bf82a399da676bf32f 23-Jan-2015 Jeff Sharkey <jsharkey@android.com> am 6ef96c48: Merge "Config NFLOG target before listening."

* commit '6ef96c4862428e02a0c4aebbfa1ed0ccbf58b46e':
Config NFLOG target before listening.
6ef96c4862428e02a0c4aebbfa1ed0ccbf58b46e 23-Jan-2015 Jeff Sharkey <jsharkey@android.com> Merge "Config NFLOG target before listening."
9088f10010646383cb48c9412b3f20b3fa434fc7 23-Jan-2015 Jeff Sharkey <jsharkey@android.com> Config NFLOG target before listening.

Otherwise the listener thread races with us and can eat the
responses to the config messages.

Bug: 19066761
Change-Id: I484fd79414731ab74ebc3ea50446e374a50eac77
erver/NetlinkManager.cpp
erver/NetlinkManager.h
452baaeec66c03e7f581bb9c577bd044239f938b 16-Jan-2015 Jeff Sharkey <jsharkey@android.com> am 732c34ee: am 535b94fa: Merge "Offer to detect non-SSL/TLS network traffic."

* commit '732c34ee7cf9fdd93e8e2aa41bac1df231d9b50b':
Offer to detect non-SSL/TLS network traffic.
732c34ee7cf9fdd93e8e2aa41bac1df231d9b50b 16-Jan-2015 Jeff Sharkey <jsharkey@android.com> am 535b94fa: Merge "Offer to detect non-SSL/TLS network traffic."

* commit '535b94fa9d88097220de3ea04cb8d9a91114baa8':
Offer to detect non-SSL/TLS network traffic.
535b94fa9d88097220de3ea04cb8d9a91114baa8 16-Jan-2015 Jeff Sharkey <jsharkey@android.com> Merge "Offer to detect non-SSL/TLS network traffic."
fbe497fcd808e4317572ad48c42545105309a347 29-Oct-2014 Jeff Sharkey <jsharkey@android.com> Offer to detect non-SSL/TLS network traffic.

Introduces new module that provides network-related features for
the StrictMode developer API. The first feature offers to detect
sockets sending data not wrapped inside a layer of SSL/TLS
encryption.

This carefully only adds overhead to UIDs that have requested
detection, and it uses CONNMARK to quickly accept/reject packets
from streams that have already been inspected. Detection is done
by looking for a well-known TLS handshake header; it's not future
proof, but it's a good start. Handles both IPv4 and IPv6.

When requested, we also log the triggering packet through NFLOG and
back up to the framework to aid investigation.

Bug: 18335678
Change-Id: Ie8fab785139dfb55a71b6dc7a0f3c75a8408224b
erver/Android.mk
erver/CommandListener.cpp
erver/CommandListener.h
erver/NetlinkHandler.cpp
erver/NetlinkHandler.h
erver/NetlinkManager.cpp
erver/NetlinkManager.h
erver/ResponseCode.h
erver/StrictController.cpp
erver/StrictController.h
2f8e725e19e151acc1f8cf564f91a2ef09139f44 06-Jan-2015 Dmitry Shmidt <dimitrysh@google.com> server: softap: Set hw_mode according to selected channel [DO NOT MERGE]

Change-Id: If3d12d33e857b1438edd504ddbd5e5504673725c
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
erver/SoftapController.cpp
82cf8cd73756a8fc2efc5c12bf19410b81103696 09-Jan-2015 Lorenzo Colitti <lorenzo@google.com> am 7e9527b4: am 32b2e795: exit instead of returning when execv()ing clatd fails.

* commit '7e9527b45d818829093545bf6abe3e1952c73e86':
exit instead of returning when execv()ing clatd fails.
7e9527b45d818829093545bf6abe3e1952c73e86 09-Jan-2015 Lorenzo Colitti <lorenzo@google.com> am 32b2e795: exit instead of returning when execv()ing clatd fails.

* commit '32b2e795204887feb324d5cfa405bc40d8c81d0e':
exit instead of returning when execv()ing clatd fails.
1ecc6c93c8538841a275c732375eacb77b3c5238 08-Jan-2015 xinhe <xinhe@google.com> set softAP on a specified band, including both 2.4 and 5 GHz band

Bug:18929692
Change-Id: Ie46d7f633bc936994d42a3b3e1c5b422461344f3
erver/SoftapController.cpp
32b2e795204887feb324d5cfa405bc40d8c81d0e 07-Jan-2015 Lorenzo Colitti <lorenzo@google.com> exit instead of returning when execv()ing clatd fails.

Returning instead of exiting when execv() fails causes mayhem, as
it results in two netd processes running, and netd commands being
processed by one of the two at random.

Bug: 18893886
Change-Id: I25afbabaef5955c9af7053b0333969b4e83549f1
erver/ClatdController.cpp
237f0a5bea8abdd245671c69b8e3c33e149d3f44 06-Jan-2015 Dmitry Shmidt <dimitrysh@google.com> server: softap: Set hw_mode according to selected channel

Change-Id: If3d12d33e857b1438edd504ddbd5e5504673725c
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
erver/SoftapController.cpp
7ad1c86e985a9ec4479bc3fedbf1546bb66649c7 06-Jan-2015 Dan Albert <danalbert@google.com> am 3dc3e542: am 1a3c689b: Merge "Fix missing errno.h includes after libc cleanup."

* commit '3dc3e5423a183930fa981fa010f653be03201774':
Fix missing errno.h includes after libc cleanup.
3dc3e5423a183930fa981fa010f653be03201774 06-Jan-2015 Dan Albert <danalbert@google.com> am 1a3c689b: Merge "Fix missing errno.h includes after libc cleanup."

* commit '1a3c689be29bfbe0c7f3eb3134e9b2a2208f839c':
Fix missing errno.h includes after libc cleanup.
1a3c689be29bfbe0c7f3eb3134e9b2a2208f839c 06-Jan-2015 Dan Albert <danalbert@google.com> Merge "Fix missing errno.h includes after libc cleanup."
aa1be2b3d24d99f3ccb98ff4fbb2a81b63587eff 06-Jan-2015 Dan Albert <danalbert@google.com> Fix missing errno.h includes after libc cleanup.

These issues hadn't been found yet because a libc++ header was
unconditionally pulling in errno.h. I've fixed the libc++ header now.

Change-Id: Ib096634cdd231fc75bf7548e4b99babc7442dc53
lient/NetdClient.cpp
erver/InterfaceController.cpp
erver/NetdConstants.cpp
erver/RouteController.cpp
f823669357e8a5af5fd2958f530bf8bc7be61364 29-Dec-2014 Elliott Hughes <enh@google.com> am 9fb832c0: am 8a8b0c6a: Merge "Include what you use: <errno.h>."

* commit '9fb832c0ee33c74f28cca8593b87ec1942684756':
Include what you use: <errno.h>.
9fb832c0ee33c74f28cca8593b87ec1942684756 29-Dec-2014 Elliott Hughes <enh@google.com> am 8a8b0c6a: Merge "Include what you use: <errno.h>."

* commit '8a8b0c6af6ba45b549228ca4339277f18894f909':
Include what you use: <errno.h>.
8a8b0c6af6ba45b549228ca4339277f18894f909 29-Dec-2014 Elliott Hughes <enh@google.com> Merge "Include what you use: <errno.h>."
27aacc0d49dbc5c3721ae5ca6f6033be6537c4c3 29-Dec-2014 Elliott Hughes <enh@google.com> Include what you use: <errno.h>.

Change-Id: Ic970f6bf4558e8e0ef3d7e480c2532c102abfd7c
lient/FwmarkClient.cpp
265470dce2dceba86b216a99395fdfaa086c3e0d 10-Dec-2014 Erik Kline <ek@google.com> am 1df4f67e: am 59273ede: Re-add netd support for enabling IPv6 optimistic mode.

* commit '1df4f67ee49a1ae06478d34167027296d28bffea':
Re-add netd support for enabling IPv6 optimistic mode.
1df4f67ee49a1ae06478d34167027296d28bffea 10-Dec-2014 Erik Kline <ek@google.com> am 59273ede: Re-add netd support for enabling IPv6 optimistic mode.

* commit '59273ede02fc91d2a3297547d959159c8c6f69f3':
Re-add netd support for enabling IPv6 optimistic mode.
eb92b6d34f934215760f204fd40e3dd52fe7c8ca 09-Dec-2014 Erik Kline <ek@google.com> am 67a07780: am 9ccaa16e: Revert "Merge "Add netd support for configuring IPv6 optimistic mode." into lmp-mr1-dev"

* commit '67a0778055a6ea97331aa1d25b442e3a164a68a2':
Revert "Merge "Add netd support for configuring IPv6 optimistic mode." into lmp-mr1-dev"
67a0778055a6ea97331aa1d25b442e3a164a68a2 08-Dec-2014 Erik Kline <ek@google.com> am 9ccaa16e: Revert "Merge "Add netd support for configuring IPv6 optimistic mode." into lmp-mr1-dev"

* commit '9ccaa16ece9059a0e62e16dbc0f8a64fec7eb7a3':
Revert "Merge "Add netd support for configuring IPv6 optimistic mode." into lmp-mr1-dev"
59273ede02fc91d2a3297547d959159c8c6f69f3 08-Dec-2014 Erik Kline <ek@google.com> Re-add netd support for enabling IPv6 optimistic mode.

Enables optimistic_dad and use_optimistic on all interfaces
by default.

---

This functionality was originally submitted in ag/569594. Owing
to issues with bind()ing to optimistic addresses (see b/18609055)
this was reverted in ag/598690.

This reverts the revert. :-)

Bug: 17769720
Change-Id: I156e5636341a846f41fb9a15c84cf06878b239d8
erver/InterfaceController.cpp
erver/InterfaceController.h
9ccaa16ece9059a0e62e16dbc0f8a64fec7eb7a3 05-Dec-2014 Erik Kline <ek@google.com> Revert "Merge "Add netd support for configuring IPv6 optimistic mode." into lmp-mr1-dev"

This is to undo ag/569594.

This reverts commit 828f8b88c78e7d7c31b098768df403e4596a91d4, reversing
changes made to ac7fefcf3d90cf856b0f1664207d056ed1dd4725.

Bug: 18609055
Bug: 17769720
Change-Id: I120745d9d01d731174f477dff9b463dede8523d7
erver/InterfaceController.cpp
erver/InterfaceController.h
4788fbabed4895cf2da6d607696c628eabcbe5e7 02-Dec-2014 Lorenzo Colitti <lorenzo@google.com> am 3c34ff3d: am dadc5f85: Add a command to clear a network\'s DNS servers.

* commit '3c34ff3d8f53e1bfa4d6b0f790d72317da8c45cf':
Add a command to clear a network's DNS servers.
3c34ff3d8f53e1bfa4d6b0f790d72317da8c45cf 02-Dec-2014 Lorenzo Colitti <lorenzo@google.com> am dadc5f85: Add a command to clear a network\'s DNS servers.

* commit 'dadc5f850ee7a4dbe9ed418ae9d363b237f7a0e8':
Add a command to clear a network's DNS servers.
dadc5f850ee7a4dbe9ed418ae9d363b237f7a0e8 29-Nov-2014 Lorenzo Colitti <lorenzo@google.com> Add a command to clear a network's DNS servers.

Bug: 18327075
Change-Id: I0df13ff4a17ee65e640be96695a3af31b020963a
erver/CommandListener.cpp
erver/ResolverController.cpp
erver/ResolverController.h
688708722530d8d50aeedf11287b98000404ec35 25-Nov-2014 Elliott Hughes <enh@google.com> am 2ac0dcb4: am a0b06f61: Merge "Plug some leaks"

* commit '2ac0dcb47d959c4944a8e38d6b5bdf8daaf86fb5':
Plug some leaks
2ac0dcb47d959c4944a8e38d6b5bdf8daaf86fb5 25-Nov-2014 Elliott Hughes <enh@google.com> am a0b06f61: Merge "Plug some leaks"

* commit 'a0b06f61c55be2ecea35d14b621553c00bf287a6':
Plug some leaks
a0b06f61c55be2ecea35d14b621553c00bf287a6 24-Nov-2014 Elliott Hughes <enh@google.com> Merge "Plug some leaks"
a9d791f48e3472400ffad73dca88c28fb2f7aaa7 27-Apr-2012 Jesper Hansson <jesper.hansson@sonymobile.com> Plug some leaks

Change-Id: I4268ea32cfb0ebd6ce5711e30865750dffa94e92
erver/BandwidthController.cpp
erver/PppController.cpp
erver/TetherController.cpp
a822aba4be9bae460a921fa1f73e8804635bf50d 14-Nov-2014 Elliott Hughes <enh@google.com> am 9aaad858: am ce0b69e2: Merge "Don\'t send structs containing pointers over sockets."

* commit '9aaad8581005ec7e0248508ebc3c5f91e4c50913':
Don't send structs containing pointers over sockets.
9aaad8581005ec7e0248508ebc3c5f91e4c50913 13-Nov-2014 Elliott Hughes <enh@google.com> am ce0b69e2: Merge "Don\'t send structs containing pointers over sockets."

* commit 'ce0b69e25ae35f93ff7253855bf8a38c7fbf0232':
Don't send structs containing pointers over sockets.
ce0b69e25ae35f93ff7253855bf8a38c7fbf0232 13-Nov-2014 Elliott Hughes <enh@google.com> Merge "Don't send structs containing pointers over sockets."
fe743018ad6ce7fb61db7f6f2efbe9832e9599dc 13-Nov-2014 Elliott Hughes <enh@google.com> Don't send structs containing pointers over sockets.

Fixes x86-64 netd.

Change-Id: Iee5ef802ebbf2e000b2593643de4eec46f296c04
erver/DnsProxyListener.cpp
0252cb06bf5ba319944d0073b75ab01dde37beaa 04-Nov-2014 Sreeram Ramachandran <sreeram@google.com> am 02828009: am 584dbee5: Don\'t use framework permission strings for netd permissions.

* commit '02828009b2ca2d91262b370d58ccee36fe67be06':
Don't use framework permission strings for netd permissions.
02828009b2ca2d91262b370d58ccee36fe67be06 04-Nov-2014 Sreeram Ramachandran <sreeram@google.com> am 584dbee5: Don\'t use framework permission strings for netd permissions.

* commit '584dbee59ceb7750e22c48371342635aa6a98517':
Don't use framework permission strings for netd permissions.
584dbee59ceb7750e22c48371342635aa6a98517 04-Nov-2014 Sreeram Ramachandran <sreeram@google.com> 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
erver/CommandListener.cpp
ff5595afc3d8e89d6b4a2bc3f5fcdf2a660a5cb8 04-Nov-2014 Robert Greenwalt <rgreenwalt@google.com> am 5e1d88b5: Write pid file so we can tell when netd bounces. automerge: 347f693

* commit '5e1d88b58d42b0cb4c3bc9ce1b347a0127a0ea10':
Write pid file so we can tell when netd bounces.
5e1d88b58d42b0cb4c3bc9ce1b347a0127a0ea10 04-Nov-2014 Robert Greenwalt <rgreenwalt@google.com> Write pid file so we can tell when netd bounces.
automerge: 347f693

* commit '347f69312176a54250a35afdc712b044c466fc73':
Write pid file so we can tell when netd bounces.
347f69312176a54250a35afdc712b044c466fc73 01-Nov-2014 Robert Greenwalt <rgreenwalt@google.com> Write pid file so we can tell when netd bounces.

We clear the file early so people know it's died and rewrite after all the
setup and flushing of data is done so people know when it's safe to
repopulate the data.

bug:18069270
Change-Id: I954cf43ff02f1d352015f128ef88b659e6d0f95a
erver/main.cpp
fa355d887efb8dc1d2a103e6bba9ab8533812e21 31-Oct-2014 Sreeram Ramachandran <sreeram@google.com> am eb4325b0: am 64166e76: Don\'t fail when trying to add routes that already exist.

* commit 'eb4325b0499bc246ed104cf4ad46b84b4e78599e':
Don't fail when trying to add routes that already exist.
eb4325b0499bc246ed104cf4ad46b84b4e78599e 31-Oct-2014 Sreeram Ramachandran <sreeram@google.com> am 64166e76: Don\'t fail when trying to add routes that already exist.

* commit '64166e7666e3cc7f4b9c715f2b4e19d28ae44c5a':
Don't fail when trying to add routes that already exist.
b564820b09c7003a4bfda743ee13c99c6a626cd5 31-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am dce9d895: am 2b8d1ead: Merge "Add a netd interface command to disable ND offload." into lmp-mr1-dev

* commit 'dce9d8959ac937249d62aebe3d6e044c015b7cff':
Add a netd interface command to disable ND offload.
86459c4af93b304a6030879b4b38aa3e455fd215 31-Oct-2014 Erik Kline <ek@google.com> am 4c631b0d: am 828f8b88: Merge "Add netd support for configuring IPv6 optimistic mode." into lmp-mr1-dev

* commit '4c631b0d17fcc3bc2d0d43fadeee2296a2aa9d76':
Add netd support for configuring IPv6 optimistic mode.
dce9d8959ac937249d62aebe3d6e044c015b7cff 31-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am 2b8d1ead: Merge "Add a netd interface command to disable ND offload." into lmp-mr1-dev

* commit '2b8d1ead4ea2ff8cb5af1ce88033a8ea0d691402':
Add a netd interface command to disable ND offload.
4c631b0d17fcc3bc2d0d43fadeee2296a2aa9d76 31-Oct-2014 Erik Kline <ek@google.com> am 828f8b88: Merge "Add netd support for configuring IPv6 optimistic mode." into lmp-mr1-dev

* commit '828f8b88c78e7d7c31b098768df403e4596a91d4':
Add netd support for configuring IPv6 optimistic mode.
64166e7666e3cc7f4b9c715f2b4e19d28ae44c5a 30-Oct-2014 Sreeram Ramachandran <sreeram@google.com> Don't fail when trying to add routes that already exist.

Previously, we suppressed failures for the special case of
requestRouteToHost() being called multiple times. Turns out that other
parts of the system also try to add duplicate routes, so just suppress
EEXIST errors in general (as far as adding routes is concerned). For
example, this happens when the WiFi P2P DHCP client renews its lease
and blindly requests to add a route that it had already added before.

Bug: 17205769
Change-Id: I3de557ddb82c95899623aa31b4b3ec7c955f5609
erver/RouteController.cpp
2b8d1ead4ea2ff8cb5af1ce88033a8ea0d691402 30-Oct-2014 Lorenzo Colitti <lorenzo@google.com> Merge "Add a netd interface command to disable ND offload." into lmp-mr1-dev
0ea8ff87012f6bda41b6d2b4629d4fd0fd6f4794 27-Oct-2014 Lorenzo Colitti <lorenzo@google.com> Add a netd interface command to disable ND offload.

This will be used to support 464xlat on wifi and IPv6 tethering.

Bug: 12111730
Change-Id: I3b97f4dfb787b2c5d5021811c6da51850bdc70d1
erver/CommandListener.cpp
erver/InterfaceController.cpp
erver/InterfaceController.h
828f8b88c78e7d7c31b098768df403e4596a91d4 30-Oct-2014 Erik Kline <ek@google.com> Merge "Add netd support for configuring IPv6 optimistic mode." into lmp-mr1-dev
f7e07dc7f272bcfafac1394c78b308566206f347 29-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am 9b1b22ef: Support more than one clatd at a time. automerge: ac7fefc

* commit '9b1b22ef23b807897ea5747fbb817e4a75222b2b':
Support more than one clatd at a time.
9b1b22ef23b807897ea5747fbb817e4a75222b2b 29-Oct-2014 Lorenzo Colitti <lorenzo@google.com> Support more than one clatd at a time.
automerge: ac7fefc

* commit 'ac7fefcf3d90cf856b0f1664207d056ed1dd4725':
Support more than one clatd at a time.
5ca2e08c8da67b3af8c8ab8066f84500ec295d06 29-Oct-2014 Robert Greenwalt <rgreenwalt@google.com> am 3d6c5b01: am 4bcd2b13: am 388cd671: (-s ours) Merge "Fix MDnsSdListener::Monitor::Monitor()"

* commit '3d6c5b01355a10469ac10538bea365ec34e8e23f':
26d9fb56adbceff7a2a26156e9c433afd7498925 29-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am 50b90a07: am 4dc100c4: am a1067c8d: Improve error return values on network selection.

* commit '50b90a07f68335492a34e0e85a69413ea22cc43e':
6476fd8801cb1f8d68876256a2a66e887111c3fa 29-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am c344c321: am f55b3e6c: am e8164ddc: Fix MSS clamping.

* commit 'c344c3219b89d70cc8b8b6b73e28e7199416dd27':
5288d4f7dfdf16650004af259f486daf7a0add4d 29-Oct-2014 Gordon Gao <njh348@motorola.com> am 165969fc: am bc9da4e6: am 6b6f22fa: Enable tcp mss clamp for Tethering

* commit '165969fcf4622fdfe9484e2cb86e808e44c4b9a6':
0eea1d9112d08efce26f42f6ca6c91b095679d34 29-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am 7a9c71c8: am 10f9a166: am 4c95a125: Support manipulating throw routes.

* commit '7a9c71c885981831570f5098b9ac96e4ffe8f059':
3d6c5b01355a10469ac10538bea365ec34e8e23f 29-Oct-2014 Robert Greenwalt <rgreenwalt@google.com> am 4bcd2b13: am 388cd671: (-s ours) Merge "Fix MDnsSdListener::Monitor::Monitor()"

* commit '4bcd2b139cdb67cfcea47d15b58f38afec0b0859':
50b90a07f68335492a34e0e85a69413ea22cc43e 29-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am 4dc100c4: am a1067c8d: Improve error return values on network selection.

* commit '4dc100c4e79200152ab5c0f9bc3e00033bfff104':
c344c3219b89d70cc8b8b6b73e28e7199416dd27 29-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am f55b3e6c: am e8164ddc: Fix MSS clamping.

* commit 'f55b3e6c9adeb628862c13266ec34c05f28425be':
165969fcf4622fdfe9484e2cb86e808e44c4b9a6 29-Oct-2014 Gordon Gao <njh348@motorola.com> am bc9da4e6: am 6b6f22fa: Enable tcp mss clamp for Tethering

* commit 'bc9da4e633165700bbcc6ba33e09f100acb88d3f':
7a9c71c885981831570f5098b9ac96e4ffe8f059 29-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am 10f9a166: am 4c95a125: Support manipulating throw routes.

* commit '10f9a166f6bfc625a07f67cf3bcc3d96b170a5de':
ac7fefcf3d90cf856b0f1664207d056ed1dd4725 20-Oct-2014 Lorenzo Colitti <lorenzo@google.com> Support more than one clatd at a time.

1. Change from a single PID to a map of interface names to PIDs.
2. Make clatd commands take an interface argument.
3. Give the clatd processes names that depend on their parent
interface, e.g., clatd-rmnet0.

Bug: 12111730
Change-Id: Ia770952d6511f8598a3356be5911da4ffa01b46a
erver/ClatdController.cpp
erver/ClatdController.h
erver/CommandListener.cpp
36b4a0d60c8ca3de3a40b964dda776a308e9f5b4 09-Oct-2014 Erik Kline <ek@google.com> Add netd support for configuring IPv6 optimistic mode.

Enables optimistic_dad and use_optimistic on all interfaces
by default.

Bug: 17769720
Change-Id: Ide492e18aa94064b890fef30d31c3a14cfdf4052
erver/InterfaceController.cpp
erver/InterfaceController.h
e06a719785eaeaabf7be6630bdfc6d045db23684 10-Oct-2014 Robert Greenwalt <rgreenwalt@google.com> am 8214b178: am 388cd671: (-s ours) Merge "Fix MDnsSdListener::Monitor::Monitor()"

* commit '8214b1782bb67d22629af35e34244f69adb80e02':
Fix MDnsSdListener::Monitor::Monitor()
8214b1782bb67d22629af35e34244f69adb80e02 10-Oct-2014 Robert Greenwalt <rgreenwalt@google.com> am 388cd671: (-s ours) Merge "Fix MDnsSdListener::Monitor::Monitor()"

* commit '388cd671ff5237aabcd728794af49d33e18fda8b':
Fix MDnsSdListener::Monitor::Monitor()
4bcd2b139cdb67cfcea47d15b58f38afec0b0859 10-Oct-2014 Robert Greenwalt <rgreenwalt@google.com> am 388cd671: (-s ours) Merge "Fix MDnsSdListener::Monitor::Monitor()"

* commit '388cd671ff5237aabcd728794af49d33e18fda8b':
Fix MDnsSdListener::Monitor::Monitor()
388cd671ff5237aabcd728794af49d33e18fda8b 09-Oct-2014 Robert Greenwalt <rgreenwalt@google.com> Merge "Fix MDnsSdListener::Monitor::Monitor()"
ad71392ad47a3918abeeaa639020dfb63d4fe510 09-Oct-2014 Kévin Petit <kevin.petit@arm.com> Fix MDnsSdListener::Monitor::Monitor()

* Initialisation of mLiveCount

The value of mLiveCount was being used without being initialised, and
this was causing the CTS class android.net.wifi.cts.NsdManagerTest
method testAndroidTestCaseSetupProperly test to fail when the calls
to calloc in the MDnsSdListener::Monitor::rescan() method returned a
value of NULL due to the large value of mPollSize, which had been set
to "mLiveCount + 5". The mPollFds and mPollRefs pointers were then used
without checking that they were not NULL, resulting in a segmentation
violation when the NULL pointer value was dereferenced. Initialising
the value of mLiveCount to zero in MDnsSdListener::Monitor::Monitor()
fixes this problem, and the test then passes.

* Also initilize mPollFds, mPollRefs and mPollSize

Change-Id: I1a8f7ee0f3ed38f46854e9ba6d5c432c9412b7c3
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Kévin Petit <kevin.petit@arm.com>
DnsSdListener.cpp
61549f775be116b4cb57a372c02cb90aca50ef73 03-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am e871b627: am 3d48bc23: am a1067c8d: Improve error return values on network selection.

* commit 'e871b627fdc4f8d54ae506a83f9024c64ddba260':
Improve error return values on network selection.
6936fd5321b858b309b2bc201210bf67cef034f0 03-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am 7241d98d: am 1c57d2b7: am e8164ddc: Fix MSS clamping.

* commit '7241d98db7d318f03f59527c7430370f6a299481':
Fix MSS clamping.
d36a58ab6f9582935deb2d23e7dce618745c13a3 03-Oct-2014 Dmitry Shmidt <dimitrysh@google.com> am bd0405f3: am 6fa06b78: softap: Ensure entropy file creation

* commit 'bd0405f3c3fb1ca62ee82610b7fb6ad1227e05c3':
softap: Ensure entropy file creation
e871b627fdc4f8d54ae506a83f9024c64ddba260 03-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am 3d48bc23: am a1067c8d: Improve error return values on network selection.

* commit '3d48bc23465becc6992756d4160550bf01799ffc':
Improve error return values on network selection.
7241d98db7d318f03f59527c7430370f6a299481 03-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am 1c57d2b7: am e8164ddc: Fix MSS clamping.

* commit '1c57d2b7141ba81a2a4e991267082a7258c09015':
Fix MSS clamping.
bd0405f3c3fb1ca62ee82610b7fb6ad1227e05c3 03-Oct-2014 Dmitry Shmidt <dimitrysh@google.com> am 6fa06b78: softap: Ensure entropy file creation

* commit '6fa06b78e31f9e99c4e61f2c4c8241823b781f89':
softap: Ensure entropy file creation
3d48bc23465becc6992756d4160550bf01799ffc 03-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am a1067c8d: Improve error return values on network selection.

* commit 'a1067c8d2b2165f1058a3a8216bed4efacfa1c80':
Improve error return values on network selection.
1c57d2b7141ba81a2a4e991267082a7258c09015 03-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am e8164ddc: Fix MSS clamping.

* commit 'e8164ddc8204b626c1144a0a504754bf6622c6fd':
Fix MSS clamping.
4dc100c4e79200152ab5c0f9bc3e00033bfff104 03-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am a1067c8d: Improve error return values on network selection.

* commit 'a1067c8d2b2165f1058a3a8216bed4efacfa1c80':
Improve error return values on network selection.
f55b3e6c9adeb628862c13266ec34c05f28425be 03-Oct-2014 Lorenzo Colitti <lorenzo@google.com> am e8164ddc: Fix MSS clamping.

* commit 'e8164ddc8204b626c1144a0a504754bf6622c6fd':
Fix MSS clamping.
a1067c8d2b2165f1058a3a8216bed4efacfa1c80 02-Oct-2014 Lorenzo Colitti <lorenzo@google.com> Improve error return values on network selection.

It's very confusing to see EPERM when opening or connecting a
socket when the problem is not security-related. In the (common)
case where an app cannot select a network because it does not
exist, return ENONET ("Machine is not on network") instead.

Also, return EREMOTEIO for when we can't figure out who the user
is, and use EPERM for VPN denials and EACCES for permission
bits.

Bug: 17702933
Change-Id: Ia680c485e0ea1efad1ad374231d994e9bfd4cd5a
erver/FwmarkServer.cpp
erver/NetworkController.cpp
erver/NetworkController.h
e8164ddc8204b626c1144a0a504754bf6622c6fd 02-Oct-2014 Lorenzo Colitti <lorenzo@google.com> Fix MSS clamping.

http://ag/553410 added an iptables chain and rule to do MSS
clamping for tethered clients, but did not add the chain to any
other chains, so the rule had no effect.

Fix this by adding the chain to the proper forwarding chains.
Also rename some of the new variables and constants so they are
more consistent with the previous code.

Bug: 17552732
Bug: 17727533
Change-Id: I9fcae31de5c0283d7d9f1dac989de84f77c5e53c
erver/CommandListener.cpp
erver/NatController.cpp
erver/NatController.h
96e35bf559fdce8c0affc879eb7cd97161cab554 29-Sep-2014 Gordon Gao <njh348@motorola.com> am 28c0a37f: am 6b6f22fa: Enable tcp mss clamp for Tethering

* commit '28c0a37f14cdc5b9f23b422541cb4d23567058b5':
Enable tcp mss clamp for Tethering
6fa06b78e31f9e99c4e61f2c4c8241823b781f89 06-Sep-2014 Dmitry Shmidt <dimitrysh@google.com> softap: Ensure entropy file creation

Bug: 17408011

Change-Id: I558270f1ce2603f305d38ad8604379ea533f0a47
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
erver/SoftapController.cpp
28c0a37f14cdc5b9f23b422541cb4d23567058b5 27-Sep-2014 Gordon Gao <njh348@motorola.com> am 6b6f22fa: Enable tcp mss clamp for Tethering

* commit '6b6f22fac4c33fcd349aaf6970bbdc191db752a3':
Enable tcp mss clamp for Tethering
bc9da4e633165700bbcc6ba33e09f100acb88d3f 27-Sep-2014 Gordon Gao <njh348@motorola.com> am 6b6f22fa: Enable tcp mss clamp for Tethering

* commit '6b6f22fac4c33fcd349aaf6970bbdc191db752a3':
Enable tcp mss clamp for Tethering
6b6f22fac4c33fcd349aaf6970bbdc191db752a3 18-Sep-2014 Gordon Gao <njh348@motorola.com> Enable tcp mss clamp for Tethering

With this change, IPv4 tethering clients (such as PC) with default
MTU size 1500 will be configured again in the phone to use MTU
matching the carrier network, then no IP fragemention in the phone
and have higher data throughput for tethering.

bug:17552732
Change-Id: Ia306b1b8454da1b0e2d9c320e770aeff172d5fc4
erver/NatController.cpp
43c6293fced61c081744c4acaa5b0a2b9a2a49d7 23-Sep-2014 Lorenzo Colitti <lorenzo@google.com> am 4e5514f5: am 4c95a125: Support manipulating throw routes.

* commit '4e5514f5d5c3574b2256358b5758347f209e6a16':
Support manipulating throw routes.
4e5514f5d5c3574b2256358b5758347f209e6a16 22-Sep-2014 Lorenzo Colitti <lorenzo@google.com> am 4c95a125: Support manipulating throw routes.

* commit '4c95a125e0930c112555437589f7620575482095':
Support manipulating throw routes.
10f9a166f6bfc625a07f67cf3bcc3d96b170a5de 22-Sep-2014 Lorenzo Colitti <lorenzo@google.com> am 4c95a125: Support manipulating throw routes.

* commit '4c95a125e0930c112555437589f7620575482095':
Support manipulating throw routes.
4c95a125e0930c112555437589f7620575482095 18-Sep-2014 Lorenzo Colitti <lorenzo@google.com> Support manipulating throw routes.

We already supported unreachable routes. Throw routes are
necessary so we can exempt the VPN endpoint from being routed
through the VPN in legacy VPN modes that do not pass traffic
through a tun or ppp interface but just directly appply IPsec
transformations to outgoing packets.

Bug: 17462989
Change-Id: I8635472ca3e96ec2866af2de48e6260ab2da13fb
erver/CommandListener.cpp
erver/NetworkController.h
erver/RouteController.cpp
erver/RouteController.h
d51ec52b3a2969f5f2b69d14a23d690166af86e6 13-Sep-2014 Dan Albert <danalbert@google.com> am 356a7a07: am 100457df: (-s ours) Merge "Remove makefile cruft."

* commit '356a7a071493bc86f7a9bd4808ddd4ebafbe5acb':
Remove makefile cruft.
356a7a071493bc86f7a9bd4808ddd4ebafbe5acb 12-Sep-2014 Dan Albert <danalbert@google.com> am 100457df: (-s ours) Merge "Remove makefile cruft."

* commit '100457df47b8a453eb94df3cf2e87f6248e783d1':
Remove makefile cruft.
100457df47b8a453eb94df3cf2e87f6248e783d1 12-Sep-2014 Dan Albert <danalbert@google.com> Merge "Remove makefile cruft."
8227fa4236deef3f2c0c6a507df5213f0dfba812 12-Sep-2014 Dan Albert <danalbert@google.com> Remove makefile cruft.

Don't manually include stlport, and don't use private bionic headers.

Change-Id: Ibe91ed010b8558fba4ce08fdcf789cbed006f6ef
ndroid.mk
3f288b057b8f004634e61277c77b95458379fe31 10-Sep-2014 Sreeram Ramachandran <sreeram@google.com> am e25a378f: am 6a834abb: Merge "Reset connections whenever an address goes away." into lmp-dev

* commit 'e25a378fbb6fb6264577dc6aa60ee8eb8deae61f':
Reset connections whenever an address goes away.
e25a378fbb6fb6264577dc6aa60ee8eb8deae61f 10-Sep-2014 Sreeram Ramachandran <sreeram@google.com> am 6a834abb: Merge "Reset connections whenever an address goes away." into lmp-dev

* commit '6a834abb5acca22e47b70ee88e55f394f909559b':
Reset connections whenever an address goes away.
6a834abb5acca22e47b70ee88e55f394f909559b 10-Sep-2014 Sreeram Ramachandran <sreeram@google.com> Merge "Reset connections whenever an address goes away." into lmp-dev
af37dd3e6f40b9fc5a30ec462a8d2504380a3c9f 09-Sep-2014 Sreeram Ramachandran <sreeram@google.com> Reset connections whenever an address goes away.

Bug: 15414453
Change-Id: Ibf1f052e12b88838a328148e25817a96f10d50f5
erver/NetlinkHandler.cpp
6c1f237fccef46ebff197c128d66475c8ab758f3 09-Sep-2014 Sreeram Ramachandran <sreeram@google.com> am a10e1efe: am bbdde990: Reserve NetIds 1..50 for OEM use.

* commit 'a10e1efe86a9844ce5cf3dd38d036f5cb5f53acd':
Reserve NetIds 1..50 for OEM use.
a10e1efe86a9844ce5cf3dd38d036f5cb5f53acd 09-Sep-2014 Sreeram Ramachandran <sreeram@google.com> am bbdde990: Reserve NetIds 1..50 for OEM use.

* commit 'bbdde9909b7b4fd31c5857156ceb00049bf4992d':
Reserve NetIds 1..50 for OEM use.
bbdde9909b7b4fd31c5857156ceb00049bf4992d 06-Sep-2014 Sreeram Ramachandran <sreeram@google.com> Reserve NetIds 1..50 for OEM use.

Also reserve 51..100 for our use.

Bug: 17303534
Change-Id: Id082368b493dc3c5b5c479e51d273458d80ec6aa
erver/CommandListener.cpp
erver/NetworkController.cpp
erver/NetworkController.h
38086e73a9b10b9f286695417fd2005d08bc71b5 04-Sep-2014 Dmitry Shmidt <dimitrysh@google.com> am 52152dd6: am 928294e4: Merge "softap: Add wowlan_triggers=any parameter" into lmp-dev

* commit '52152dd66c161bf04af1809c62754ae406facc8d':
softap: Add wowlan_triggers=any parameter
52152dd66c161bf04af1809c62754ae406facc8d 04-Sep-2014 Dmitry Shmidt <dimitrysh@google.com> am 928294e4: Merge "softap: Add wowlan_triggers=any parameter" into lmp-dev

* commit '928294e4e778338c2a120c96373a779de8027ec6':
softap: Add wowlan_triggers=any parameter
928294e4e778338c2a120c96373a779de8027ec6 04-Sep-2014 Dmitry Shmidt <dimitrysh@google.com> Merge "softap: Add wowlan_triggers=any parameter" into lmp-dev
9e957530d8b2f68473f06c8b46f20e571b072578 04-Sep-2014 Dmitry Shmidt <dimitrysh@google.com> softap: Add wowlan_triggers=any parameter

New kernels in wiphy_suspend() will call cfg80211_leave_all()
that will eventually end up in cfg80211_stop_ap() unless
wowlan_triggers were set.

Bug: 17269024

Change-Id: I609d78f5bb573b4c6a9dae25a3b2a345499f6853
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
erver/SoftapController.cpp
0537152145e8fa081913b75ec5648b83766c30f2 03-Sep-2014 Lorenzo Colitti <lorenzo@google.com> am a47ea0b4: am 667c4771: Add a socket mark parameter to tethering DNS commands.

* commit 'a47ea0b4e4e40c8ee184fe1b53faf255bee29b44':
Add a socket mark parameter to tethering DNS commands.
a47ea0b4e4e40c8ee184fe1b53faf255bee29b44 03-Sep-2014 Lorenzo Colitti <lorenzo@google.com> am 667c4771: Add a socket mark parameter to tethering DNS commands.

* commit '667c477133318e4779819d34364194c8e5eaf19c':
Add a socket mark parameter to tethering DNS commands.
667c477133318e4779819d34364194c8e5eaf19c 26-Aug-2014 Lorenzo Colitti <lorenzo@google.com> Add a socket mark parameter to tethering DNS commands.

This allows the framework to pass down to dnsmasq the socket mark
to use for DNS queries.

Bug: 16357676
Change-Id: I8933b6de198a92c2aaf0291931ace8966ddba275
erver/CommandListener.cpp
erver/ResponseCode.h
erver/TetherController.cpp
erver/TetherController.h
4aa79fa7f79c029b04a0dc026039617a6c0dcc65 27-Aug-2014 Dan Albert <danalbert@google.com> Need to link libc++ as well as include.

Same as I17a390e2aff52faba90e7022a6c68a745c1fa74b, but also for
netd/client.

Change-Id: Ie555232616eb5997f05b9479fe8c5be1eb65f383
lient/Android.mk
67cbbfe38c843e1b6f5afaaa0f3e38cf29676b64 27-Aug-2014 Dan Albert <danalbert@google.com> Need to link libc++ as well as include.

This has been working for the time being because netd has only been
using parts of libc++ that are defined in headers. While updating
libc++, this has changed, and the symptoms of not linking now show.

Bug: 17255369
Change-Id: I17a390e2aff52faba90e7022a6c68a745c1fa74b
erver/Android.mk
eb74641ad7cb8d8df539fe005806f73cb87dba6a 15-Aug-2014 Lorenzo Colitti <lorenzo@google.com> am 99286fe1: Make destroying networks more robust.

* commit '99286fe1ef6fc325c28dd10b651b5adedd549495':
Make destroying networks more robust.
99286fe1ef6fc325c28dd10b651b5adedd549495 12-Aug-2014 Lorenzo Colitti <lorenzo@google.com> Make destroying networks more robust.

1. Retry route flushes if they fail.
2. Make destroyNetwork ignore (but return) errors.

Bug: 16944962
Change-Id: I26301613437d7cc373ff64955fd44d716e9982b9
erver/NetworkController.cpp
erver/RouteController.cpp
988621a3d3cad7d8de350d711cd9198d0518f197 07-Aug-2014 Paul Jensen <pauljensen@google.com> am 6a46f338: Revert DNS cache flush command deletion from "Cleanup: Delete dead code."

* commit '6a46f3384b3f48e6ef77a83a5e058a47a2939a0d':
Revert DNS cache flush command deletion from "Cleanup: Delete dead code."
6a46f3384b3f48e6ef77a83a5e058a47a2939a0d 06-Aug-2014 Paul Jensen <pauljensen@google.com> Revert DNS cache flush command deletion from "Cleanup: Delete dead code."

This reverts part of commit 1604e18615f824adb2d54c36320069ba6fcb4796.
The DNS cache flushing code needs to be called when routes change.

Change-Id: I20d39eabfa088deeeeeff0c3292b1910fd948b0d
bug:16549455
erver/CommandListener.cpp
erver/ResolverController.cpp
erver/ResolverController.h
60eb6a4236f33d82ead5d44b8a14863376031a78 04-Aug-2014 Narayan Kamath <narayan@google.com> am 10190d06: Merge "Fix initialization of Monitor fields." into lmp-dev

* commit '10190d06d273577d85c42a947e4e0ab804411733':
Fix initialization of Monitor fields.
e4c09a236926cd04c5fda1d83bb0deb781378a1b 04-Aug-2014 Robert Greenwalt <rgreenwalt@google.com> am 47f8597b: Add logging of calloc failures.

* commit '47f8597b42b849d22c6cc128f27bba4a7692d371':
Add logging of calloc failures.
10190d06d273577d85c42a947e4e0ab804411733 04-Aug-2014 Narayan Kamath <narayan@google.com> Merge "Fix initialization of Monitor fields." into lmp-dev
30ffdfa62cb6bd8807b3d8eb529e2e8abaa80386 04-Aug-2014 Narayan Kamath <narayan@google.com> Fix initialization of Monitor fields.

mLiveCount was never initialized. Also moves
initialization of mPollCount to the constructor, where
it belongs. Also, fields are now initialized in the order
in which they are declared.

bug: 16734745

Change-Id: I9cc668a6fc5649d3ea550bc3a47c0eef210cad07
erver/MDnsSdListener.cpp
47f8597b42b849d22c6cc128f27bba4a7692d371 02-Aug-2014 Robert Greenwalt <rgreenwalt@google.com> Add logging of calloc failures.

Re-adding after build-break and revert

bug:16734745
Change-Id: I26f9ff8c43836fd35778db61915ce37fd2025ba7
erver/MDnsSdListener.cpp
4fd3f484524d5353107e599f729a99c61f93ee37 02-Aug-2014 Ben Murdoch <benm@google.com> am 515a5909: Merge "Revert "Add logging of calloc failures."" into lmp-dev

* commit '515a59097e8b6d87023b824554e82b98aca8edf5':
Revert "Add logging of calloc failures."
28c181763ce9b9336763daa80a9fa3861ae1285f 02-Aug-2014 Robert Greenwalt <rgreenwalt@google.com> am 3bc81979: Merge "Add logging of calloc failures." into lmp-dev

* commit '3bc819792bc617427512b0fe7b60c7ce2653094e':
Add logging of calloc failures.
515a59097e8b6d87023b824554e82b98aca8edf5 02-Aug-2014 Ben Murdoch <benm@google.com> Merge "Revert "Add logging of calloc failures."" into lmp-dev
445203a15514d10d6914993c41155b9a504474c4 02-Aug-2014 Ben Murdoch <benm@google.com> Revert "Add logging of calloc failures."

This reverts commit 96dd5bfec1693fee29ed0c728cf6ab4f0f0ec6e9 as it breaks the
64b build.

Bug: 16734745
Change-Id: Icf83b35ca0f99c2b5d6d919cfc8c2b02ee980e0b
erver/MDnsSdListener.cpp
96dd5bfec1693fee29ed0c728cf6ab4f0f0ec6e9 02-Aug-2014 Robert Greenwalt <rgreenwalt@google.com> Add logging of calloc failures.

bug:16734745
Change-Id: I30437983e93fc2420e291e3d2e6ffbe4d8a47af4
erver/MDnsSdListener.cpp
0d21637033d2d88e8593a122fab86695b545105e 01-Aug-2014 Paul Jensen <pauljensen@google.com> am 6d7e6235: Remove default routing rule & table before we forget table number.

* commit '6d7e6235b560be2ead9889c4035184573ab1b70a':
Remove default routing rule & table before we forget table number.
6d7e6235b560be2ead9889c4035184573ab1b70a 01-Aug-2014 Paul Jensen <pauljensen@google.com> Remove default routing rule & table before we forget table number.

We clear the interface index cache when we remove an interface from a
network, so we must only do this after we remove the default rule so
we still know the table number (calculated from interface index).

bug:16728065
Change-Id: I538673dcba49820a9e21f60407754fae30de02cf
erver/PhysicalNetwork.cpp
3bc819792bc617427512b0fe7b60c7ce2653094e 02-Aug-2014 Robert Greenwalt <rgreenwalt@google.com> Merge "Add logging of calloc failures." into lmp-dev
b06ca23791fdb48183f6359c719cbcad12810dfa 31-Jul-2014 Lorenzo Colitti <lorenzo@google.com> am 738c93ee: Minor improvements to NetworkController error reporting.

* commit '738c93ee075354ffafb3a8ceef76e9aa711f057b':
Minor improvements to NetworkController error reporting.
738c93ee075354ffafb3a8ceef76e9aa711f057b 30-Jul-2014 Lorenzo Colitti <lorenzo@google.com> Minor improvements to NetworkController error reporting.

Currently, when trying to perform an operation on netId that
does not exist, we return EINVAL. This can be confusing
because lots of things can return EINVAL for many different
reasons.

Instead, change this to ENONET ("Machine is not on network"),
which was what Sreeram originally implemented before we changed
it to EINVAL. I also considered ENOENT ("No such file or
directory"), but on reflection that seems less appropriate, and
it's used by other things as well. ENONET appears to have no
uses in our tree. It is also clearly separate from the ESRCH we
return for nonexistent rules.

While I'm at it, also disambiguate some of the
if (foo || bar ) { return EFOO; } to return two different error
codes.

Bug: 16667349
Change-Id: Ief2d720a58679aa746f5ba273d545487d0825e52
erver/NetworkController.cpp
9b666c6026ec3f93037e4fb35ce0bada2d7329fb 29-Jul-2014 Lorenzo Colitti <lorenzo@google.com> am db74dba7: Stop copying directly-connected routes to the main table, #2.

* commit 'db74dba7ccfe9e9504e0acd440a23fed96682842':
Stop copying directly-connected routes to the main table, #2.
d49ddd85183a7d603a5fb72ca54c8980293bc927 29-Jul-2014 Lorenzo Colitti <lorenzo@google.com> am a2c23052: Revert "Stop copying directly-connected routes to the main table."

* commit 'a2c230520be5fdafce8bbc0b6ee52262f981f75a':
Revert "Stop copying directly-connected routes to the main table."
da240002feb04f51e7a5bf064d89a3debcaa8fe2 29-Jul-2014 Lorenzo Colitti <lorenzo@google.com> am 2f5ea0e9: Stop copying directly-connected routes to the main table.

* commit '2f5ea0e99e9a436cd43901b1772b77a410a62f8d':
Stop copying directly-connected routes to the main table.
36cab91651d10cc39ac80045f1e59cd1cc03d219 29-Jul-2014 Sreeram Ramachandran <sreeram@google.com> am 2bff72e0: Add "scope link" when adding routes without a nexthop.

* commit '2bff72e0cf091f4d71af0c81cfc74e8ebd8c6644':
Add "scope link" when adding routes without a nexthop.
db74dba7ccfe9e9504e0acd440a23fed96682842 29-Jul-2014 Lorenzo Colitti <lorenzo@google.com> Stop copying directly-connected routes to the main table, #2.

For a long time we have thought that copying directly-connected
routes to the main table was necessary to add gatewayed routes
to other routing tables. However, this is not necessary when the
directly-connected routes are properly created with "scope link"
as we do in http://ag/513100 .

Delete the copying code, but don't delete the rule that looks up
the main table or the code that dumps it. The main table is used
for things like cell networking, because the RIL emulates cell
networks, which are actually point-to-point, as directly
connected broadcast subnets (e.g., a /30 or a /27) with a fake
default gateway. The directly-connected route that covers the
fake default gateway is implicitly created by adding the IP
address, but it's in the main table, so we can't add the default
route without looking up the main table.

Change-Id: I93bd4764ac75fdcc98fa4206c601524100d53fc3
erver/RouteController.cpp
a2c230520be5fdafce8bbc0b6ee52262f981f75a 29-Jul-2014 Lorenzo Colitti <lorenzo@google.com> Revert "Stop copying directly-connected routes to the main table."

This reverts commit 2f5ea0e99e9a436cd43901b1772b77a410a62f8d.

Change-Id: I1fe1df0249714cb650a34fae56476236ac0108e3
erver/RouteController.cpp
2f5ea0e99e9a436cd43901b1772b77a410a62f8d 29-Jul-2014 Lorenzo Colitti <lorenzo@google.com> Stop copying directly-connected routes to the main table.

For a long time we have thought that copying directly-connected
routes to the main table was necessary to add gatewayed routes
to other routing tables. However, this is not necessary when the
directly-connected routes are properly created with "scope link"
as we do in http://ag/513100 .

Delete the copying code, but keep dumping the main table in
bugreports, so we can see if third-party code such as RIL
daemons is putting anything in it.

Change-Id: Iddd531daaf9881ffd82f0a4b4f6cc857ce8788fd
erver/RouteController.cpp
2bff72e0cf091f4d71af0c81cfc74e8ebd8c6644 18-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Add "scope link" when adding routes without a nexthop.

This is consistent with what /sbin/ip does, and it makes
recursive lookups on secondary tables work even when the main
table is empty.

This was originally proposed by Sreeram as http://ag/506456 to
fix a VPN issue, but then abandoned because it did not fix that
particular problem.

Bug: 16628572
Change-Id: I85753389c683ae2127b21af722463a35a33b60eb
erver/RouteController.cpp
0d62f11e531bd493f378011257ed14d2150f85b2 28-Jul-2014 Sreeram Ramachandran <sreeram@google.com> am 060d855a: Merge "Prohibit address families by default unless a VPN explicitly allows them." into lmp-dev

* commit '060d855a00cb94e8903fd1551c9bf040f42b57d1':
Prohibit address families by default unless a VPN explicitly allows them.
7a9fd2b5e6c40b8f2e2c264e7d7ffa2ee3311f4f 28-Jul-2014 Sreeram Ramachandran <sreeram@google.com> am 507e7c5b: Merge "Fix fwmark handling for bypassable VPNs and DNS." into lmp-dev

* commit '507e7c5bbfcd1d68f67477866497adb1748c5fd5':
Fix fwmark handling for bypassable VPNs and DNS.
7ad5e080a3d83ecf7e7ef63d012968562643800a 28-Jul-2014 Sreeram Ramachandran <sreeram@google.com> am 48e19b03: Implement the fallthrough rule to support split tunnel VPNs.

* commit '48e19b037e7e20674048ef76bf31ce65c741347c':
Implement the fallthrough rule to support split tunnel VPNs.
060d855a00cb94e8903fd1551c9bf040f42b57d1 28-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Merge "Prohibit address families by default unless a VPN explicitly allows them." into lmp-dev
de5d5df753dd35d852ac47a6174b06eacd0d5523 27-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Prohibit address families by default unless a VPN explicitly allows them.

Bug: 15972465
Change-Id: I3278d94536fefacc86390c1ba4231680f7be8589
erver/CommandListener.cpp
erver/NetworkController.h
erver/RouteController.cpp
erver/RouteController.h
48e19b037e7e20674048ef76bf31ce65c741347c 23-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Implement the fallthrough rule to support split tunnel VPNs.

Change-Id: Ibc48caedb5954c6b12bfa553d978bab56c4b09aa
erver/Network.cpp
erver/Network.h
erver/NetworkController.cpp
erver/NetworkController.h
erver/PhysicalNetwork.cpp
erver/PhysicalNetwork.h
erver/RouteController.cpp
erver/RouteController.h
24c0ba5a2b6a9c4515aa7ccfc2d767470a0efb34 26-Jul-2014 Sreeram Ramachandran <sreeram@google.com> am 95684ba1: Implement support for bypassable VPNs.

* commit '95684ba176a9fe5ea59207d7202e47fa12bbfdbe':
Implement support for bypassable VPNs.
95684ba176a9fe5ea59207d7202e47fa12bbfdbe 23-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Implement support for bypassable VPNs.

Bypassable VPNs grab all traffic by default (just like secure VPNs), but:
+ They allow all apps to choose other networks using the multinetwork APIs.
If these other networks are insecure ("untrusted"), they will enforce that the
app holds the necessary permissions, such as CHANGE_NETWORK_STATE.
+ They support consistent routing. If an app has an existing connection over
some other network when the bypassable VPN comes up, it's not interrupted.

Bug: 15347374
Change-Id: Iaee9c6f6fa8103215738570d2b65d3fcf10343f3
erver/CommandListener.cpp
erver/NetworkController.cpp
erver/NetworkController.h
erver/RouteController.cpp
erver/RouteController.h
erver/VirtualNetwork.cpp
erver/VirtualNetwork.h
507e7c5bbfcd1d68f67477866497adb1748c5fd5 28-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Merge "Fix fwmark handling for bypassable VPNs and DNS." into lmp-dev
1011b4941d96d9fd90bc7243be387b63ec775936 25-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Fix fwmark handling for bypassable VPNs and DNS.

This is a significant change to the way fwmarks are handled for two purposes:

1. Bypassable VPN.

This was introduced in http://ag/510058 and had an issue that if there's a
default network, it would always be used in connect(), so the bypassable VPN
wouldn't get any traffic. This CL fixes that issue by using the bypassable
VPN's NetId in connect(). See the comments in the code for more details.

2. DNS.

The previous DNS code (specifically, getNetworkForUser()) had two problems:

+ Even if a user asks for a NetId they have permission for, we'd always use
the user's VPN if they were subject to one. So, for example, a system IMS
app that brings up the mobile network in the presence of a VPN would still
have its DNS queries sent over the VPN, instead of mobile as desired.

+ Any user could perform DNS over any valid network, even one they didn't
have permissions for, as long as they weren't subject to a VPN. So, for
example, an app could use the DNS servers of a different profile's VPN.

This CL fixes those problems. See getNetworkForDns() for more details.

The two pieces above are inter-related. Previously, we never set the explicit
bit from the DNS code. But we need to do that if the user asks for a network
explicitly, for two reasons:

o So that the DNS query is really restricted to that network and doesn't
fallthrough to the default network.

o So that the heuristic described in ON_CONNECT works in all cases. I.e., if the
DNS proxy's connect() request comes in with the explicit bit NOT set, we know
that the NetId can only be either the default network or a VPN.

This CL is not intended to be robust against race conditions. In general, very
little of the netd code is resilient. A separate effort needs to be undertaken
to carefully audit all the code and logic to guard against things like:

* A VPN being established between calls to getNetworkForDns() and connect().
* State changes between multiple calls to NetworkController from clients such as
FwmarkServer and DnsProxyListener.
* Routing rules / iptables rules being set up in a less-than-ideal order.
* ... etc.

Bug: 15347374
Change-Id: I5baad9168c4f4f3ef4129e07234b4bf24b0d8ba2
erver/DnsProxyListener.cpp
erver/DnsProxyListener.h
erver/FwmarkServer.cpp
erver/NetworkController.cpp
erver/NetworkController.h
4f1b6d92c1046d0ec52d3c04c601504afa184810 23-Jul-2014 Sreeram Ramachandran <sreeram@google.com> am 111bec20: Implement the rule to forward traffic to local networks via VPNs.

* commit '111bec203e82bdc9fb2c27df7c232465dffeee5f':
Implement the rule to forward traffic to local networks via VPNs.
111bec203e82bdc9fb2c27df7c232465dffeee5f 23-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Implement the rule to forward traffic to local networks via VPNs.

Change-Id: I4bffb2ce854a6fa7d4c0d35b97f123d91c6a84d6
erver/RouteController.cpp
8679d13b3f33614995a05bcec0aeb45cb5098f7c 23-Jul-2014 Sreeram Ramachandran <sreeram@google.com> am fa9f4dcd: Cosmetic: Move some functions around to match rule priority order.

* commit 'fa9f4dcd79dcfd24af276263159c5315abb06df6':
Cosmetic: Move some functions around to match rule priority order.
fa9f4dcd79dcfd24af276263159c5315abb06df6 23-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Cosmetic: Move some functions around to match rule priority order.

Change-Id: I81af639b66ac66272e0fae2d53119de1bfa12e69
erver/RouteController.cpp
fbd4db8a489b9647e74c8294df0d2a0f12dbfdf3 23-Jul-2014 Sreeram Ramachandran <sreeram@google.com> am 182a26ff: Remove the oif=iface clause when tethering.

* commit '182a26ff95515179b1a7e62a806f90279cdcd9b3':
Remove the oif=iface clause when tethering.
41c379f5e5c4008e9d7e4552d0f4a6c2015f0eba 23-Jul-2014 Sreeram Ramachandran <sreeram@google.com> resolved conflicts for merge of 1604e186 to lmp-dev-plus-aosp

Change-Id: Ia37af0e92adc8c119ce170e072f4cd3899927bf6
182a26ff95515179b1a7e62a806f90279cdcd9b3 23-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Remove the oif=iface clause when tethering.

The rule is meant to be "iif=inputIface => lookup <table_for_outputIface>", not
"iif=foo oif=bar => lookup <table_for_bar>" (the latter would never match
because packets coming in on the input interface will not have any output
interface binding).

Bug: 16242255
Change-Id: I98a2a8ab90765aee833134297b58d4f7a212036f
erver/RouteController.cpp
1604e18615f824adb2d54c36320069ba6fcb4796 20-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Cleanup: Delete dead code.

Bug: 15413389
Change-Id: I315468832ef18ffc84174e54774ab63b86d284dc
erver/Android.mk
erver/CommandListener.cpp
erver/CommandListener.h
erver/InterfaceController.cpp
erver/InterfaceController.h
erver/ResolverController.cpp
erver/ResolverController.h
erver/ResponseCode.h
erver/SecondaryTableController.cpp
erver/SecondaryTableController.h
7413cdd1e6b2c2cb8e995f96c3d99825e3261e7c 22-Jul-2014 Sreeram Ramachandran <sreeram@google.com> am 8b3b91c6: Try to undo iptables rules if a command fails.

* commit '8b3b91c6cad577e2928a29073fc962c57ef75af5':
Try to undo iptables rules if a command fails.
8b3b91c6cad577e2928a29073fc962c57ef75af5 22-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Try to undo iptables rules if a command fails.

As per review comments at:
https://googleplex-android-review.git.corp.google.com/#/c/504240/5/server/NatController.cpp@194

Bug: 15413694
Bug: 15413741
Change-Id: I99e2f83792fa81498447e4c03f5f8be1d2c43b7d
erver/NatController.cpp
d9286de65bf61571e8a91774bc21b8ee10e53802 22-Jul-2014 Sreeram Ramachandran <sreeram@google.com> am b717e74d: Flush routing rules and add an "unreachable" rule on Init().

* commit 'b717e74df3571951890cf36ee8bd559501d7fdc4':
Flush routing rules and add an "unreachable" rule on Init().
31869862448906944ff7c186a4c34b2d4f956cbb 22-Jul-2014 Sreeram Ramachandran <sreeram@google.com> am 87475a14: Fix WiFi-Direct and Tethering.

* commit '87475a1471373b72ffc9f81f17dfd7884723fa86':
Fix WiFi-Direct and Tethering.
b717e74df3571951890cf36ee8bd559501d7fdc4 19-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Flush routing rules and add an "unreachable" rule on Init().

Without the flush, rules accumulate duplicates when netd is restarted due to a
runtime restart. Nothing functionally wrong with having duplicates; it just
makes the output of "ip rule" look as though something went wrong in the system.

Time to add the unreachable rule, to suss out issues with corner cases. With the
flush, there's no more a naked "from main" rule that we need to protect by
adding the unreachable rule. But it's a good idea to add the unreachable rule
anyway, in case somebody comes along and adds a rule below it later.

Change-Id: I975b2221868b7f5366bd7cf60937a82fb4b75913
erver/RouteController.cpp
87475a1471373b72ffc9f81f17dfd7884723fa86 16-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Fix WiFi-Direct and Tethering.

A LocalNetwork object now always exists in the NetworkController, with a fixed
NetId that's guaranteed not to collide with NetIds created by the framework.

When routes are added on an interface tracked by the LocalNetwork, they are
added to a fixed "local_network" table.

When NAT is enabled, we add a special "iif -> oif" tethering rule.

Bug: 15413694
Bug: 15413741

Change-Id: I36effc438d5ac193a77174493bf196cb68a5b97a
erver/CommandListener.cpp
erver/NatController.cpp
erver/NatController.h
erver/NetworkController.cpp
erver/NetworkController.h
erver/RouteController.cpp
erver/RouteController.h
erver/TetherController.cpp
erver/TetherController.h
7d3d2f4fad773aa94652aaea2fadfd41a00fefb0 19-Jul-2014 Sreeram Ramachandran <sreeram@google.com> am f5d949ef: Merge "Don\'t choke if IPv6 rules fail."

* commit 'f5d949ef0991737af9daa7ba702cc2ec638e435b':
Don't choke if IPv6 rules fail.
f5d949ef0991737af9daa7ba702cc2ec638e435b 19-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Merge "Don't choke if IPv6 rules fail."
2909b935203da036f7d9fdccb138ac74397f42e4 17-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Don't choke if IPv6 rules fail.

On networks with a low MTU, these IPv6 commands may fail because v6 requires a
minimum MTU of 1280. Ignore the failures, since these networks are clearly meant
to be IPv4 only.

Bug: 15466895
Change-Id: Ie8f24f6e7a316633fb60661a07a3e715b6ab6add
econdaryTableController.cpp
070b2d296de30e3dbc68c21f542acb1f2914d870 12-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Don't reset a VPN's NetId in the connect() shim.

Change-Id: I0cc6c0e221a40c9100c8f4c0c5e761fce3f9b0ae
erver/FwmarkServer.cpp
erver/NetworkController.cpp
erver/NetworkController.h
a69d9472ac48d4e09f049fb740e60b7217e03861 12-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Introduce a SELECT_FOR_USER fwmarkd command.

This lets SYSTEM apps mark a socket with the network that would apply to an
arbitrary UID. I.e., either the VPN that applies to that user, or the default
network, if there's no such VPN.

This command will be used by system apps that proxy stuff for a user, so that
they can route the same way that user would have. Examples of such system apps
are the DnsProxyListener, MediaServer and DownloadManager.

The "explicit" bit is NOT set, so that if the user's VPN is a split tunnel, the
route lookup will fall-through to the default network as desired.

The "protect" bit is set, so that the socket bypasses any VPN applicable to the
system app itself. Note that even if the uid being proxied for is also subject
to the same VPN, this still works because the relevant rule doesn't care about
the protected bit (see modifyVpnSystemPermissionRule() in RouteController.cpp).

Change-Id: I4d501e5214b127f4ae9eaeb7befb1751cd102308
lient/NetdClient.cpp
nclude/FwmarkCommand.h
nclude/NetdClient.h
erver/FwmarkServer.cpp
335f2936156ca7b3b4d0a64446dc7545492f0476 12-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Cosmetic: Remove unnecessary constructor.

Change-Id: Ib1de6e8988c4728e962da8607d0ecd98d6121e0c
nclude/Fwmark.h
erver/ClatdController.cpp
b31e085466c95e5e89de6e06ebc3547c85e98242 12-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Merge "Add default routing tables to rt_tables."
bb40d5198943df0e2a88514cbcd82a23a5b0cd97 11-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Add default routing tables to rt_tables.

This is so that these tables also get dumped by bugreport / dumpstate.

Change-Id: Ia5ed8a23911d7b34ba964934dec42849f4a73824
erver/RouteController.cpp
6a773534e7f8541f221f27fb8063af079b1a5936 11-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Fix tethering in the case of a regular upstream connection.

Fixes tethering via Ethernet, Bluetooth and WiFi (hotspot).

Tethering when the upstream has a DUN-specific APN is likely still broken
(untested).

For now, assign a fixed NetId (a hack) until we can change the framework to
create a valid NetworkAgent and all that jazz.

Bug: 15968336
Bug: 14988803
Change-Id: Idcf4d492d9329a9c87913e27be6dd835a792bea2
erver/Android.mk
erver/CommandListener.cpp
erver/LocalNetwork.cpp
erver/LocalNetwork.h
erver/NatController.cpp
erver/NatController.h
erver/Network.h
erver/NetworkController.cpp
erver/NetworkController.h
erver/RouteController.cpp
erver/RouteController.h
erver/TetherController.cpp
erver/TetherController.h
c7d804c1d22db40ac79fde46a032cd359e975f5b 09-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Cosmetic: Move constants into file scope.

Change-Id: Ic1398a5867693bb8f1e588e727869ec6a4574432
erver/RouteController.cpp
4acd34a8e95b1191318216ebad409ec5e1b3d5f0 08-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Add symbolic table names for routing table numbers.

This makes the output from "ip rule" much more readable.

Companion changes are in AOSP.

Change-Id: I69deb1a64d5d6647470823405bf0cc55b24b22de
erver/RouteController.cpp
erver/RouteController.h
e09b20aee85f1dfd8c18c3d8581ac875d939ba70 06-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Add full support for UIDs in VPNs.

Major:
+ Implement the functions mentioned in http://go/android-multinetwork-routing
correctly, including handling accept(), connect(), setNetworkForSocket()
and protect() and supporting functions like canUserSelectNetwork().
+ Eliminate the old code path of getting/setting UID ranges through
SecondaryTableController (which is currently unused) and mUidMap.

Minor:
+ Rename some methods/variables for clarity and consistency.
+ Moved some methods in .cpp files to match declaration order in the .h files.

Bug: 15409918
Change-Id: Ic6ce3646c58cf645db0d9a53cbeefdd7ffafff93
erver/ClatdController.cpp
erver/CommandListener.cpp
erver/DnsProxyListener.cpp
erver/DnsProxyListener.h
erver/FwmarkServer.cpp
erver/FwmarkServer.h
erver/NatController.cpp
erver/Network.cpp
erver/Network.h
erver/NetworkController.cpp
erver/NetworkController.h
erver/PhysicalNetwork.h
erver/RouteController.cpp
erver/SecondaryTableController.cpp
erver/SecondaryTableController.h
erver/UidRanges.cpp
erver/UidRanges.h
erver/VirtualNetwork.cpp
erver/VirtualNetwork.h
5009d5ef3fbcdc69d772b528fd22184b7d605afa 03-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Update routing rules.

As per the latest changes to: http://go/android-multinetwork-routing

Functional changes:
+ Add explicit=NO to the implicit network rules, though it's a no-op.
+ Remove most of the UID=0 (kernel access) rules since they are no longer
needed, except in one case to allow access to a VPN.
+ Add the explicit, protect and permissions bits to the incoming packet mark.
+ VPNs now don't need an implicit network rule.
+ Modifying network permissions now modifies the incoming packet mark as well.

Cosmetic changes:
+ Renamed the legacy tables to match their permissions (SYSTEM and NETWORK).
+ Renamed most functions and methods for clarity and consistency.
+ Renamed and adjusted some ule priorities.
+ Move most rule modifications into their own functions, to prevent brittle
reliance on the previous state of the fwmark/mask variables.

Change-Id: I958a7e158ee918d5254de606fcfa55fe23327438
erver/NetworkController.cpp
erver/PhysicalNetwork.cpp
erver/RouteController.cpp
erver/RouteController.h
erver/VirtualNetwork.cpp
ed4bd1f7d219f9f5f56763ea02cf4947e78397f6 05-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Fix permissions handling.

+ Rename the permissions as per: http://go/android-multinetwork-routing
+ Make the SYSTEM permission explicitly include NETWORK.
+ Grant the SYSTEM permission to system UIDs by default, but allow the framework
to override them if necessary.
+ Move the "string to permission" parsing to CommandListener.cpp, thus allowing
us to get rid of Permission.cpp.
+ There's no need to support multiple permissions string arguments, so tighten
that up.

Change-Id: I73d51b5e2f44a97e6d5ab5943ff198cebfbcc0c4
nclude/Permission.h
erver/Android.mk
erver/ClatdController.cpp
erver/CommandListener.cpp
erver/FwmarkServer.cpp
erver/NetworkController.cpp
erver/NetworkController.h
erver/Permission.cpp
erver/RouteController.cpp
a675b00423e5a370e72a7f10f6b632b4d15a1ff4 05-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Only add permissions in accept(); do not try to enforce anything.

Previously, we were enforcing that the user has access to the network over which
the socket is accepted. This has two problems:

1. We weren't handling the loopback interface ('lo') correctly. It's not part of
any network, so the NetId in the fwmark is NETID_UNSET. In
NetworkController::isUserPermittedOnNetwork(), we would fail to find a valid
network, and so we would return false.

2. We have decided that in fact, we don't want to enforce this even for other
interfaces, due to the SYN-ACK problem. See the comments and discussion at:
http://go/android-multinetwork-routing

Bug: 16079376
Change-Id: I3f07f67d06dd7b48bfdfa5616ee22e098e31f8af
erver/FwmarkServer.cpp
72999d6cfc1df23cd911b85730f1f532fb62bed4 03-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Fix regressions in flushRoutes().

http://ag/486276 left out a comma, causing the command to be "routeflush" (which
is invalid), instead of the correct "route flush".

http://ag/495068 changed the order, causing the interface to be removed from the
interfaceToIndex map before we are done using it in modifyPerNetworkRules().

Change-Id: I65af0b5763b13e47b48e7e2b81d243dc19e1a03b
erver/RouteController.cpp
d36c49c1d66585769d33d95f0eb2c9c524b337a4 02-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Minor style change.

Change-Id: Ib1f89bff55506cf3881047dd876adbf97c789423
lient/NetdClient.cpp
89dad013e4dd98434b0409a84567f38782894029 02-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Keep track of users allowed to call protect() explicitly.

This is an API change between ConnectivityService and Netd.

The ownerUid was meant for this purpose, but it's insufficient, as apps need to
call protect() _before_ they create a VPN.

Bug: 15409918
Change-Id: If804aa106002e96d5ffb623d32db35fd76928367
erver/CommandListener.cpp
erver/Network.cpp
erver/Network.h
erver/NetworkController.cpp
erver/NetworkController.h
erver/VirtualNetwork.cpp
erver/VirtualNetwork.h
36ed53e37b2639681055b2d3d8777241e7dd6982 02-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Cosmetic: Add a way to query the type of a network.

This is a cosmetic change, i.e., there's no change in functionality.

This is the poor man's RTTI. It turns out that maintaining separate lists (or
maps) of the different types of networks gets burdensome pretty quickly
(especially in an upcoming CL where we add functions like
canUserSelectNetwork()).

Change-Id: If5250c0fc106045f681d0fd71278b793addbe1e3
erver/Network.h
erver/NetworkController.cpp
erver/NetworkController.h
erver/PhysicalNetwork.cpp
erver/PhysicalNetwork.h
erver/VirtualNetwork.cpp
erver/VirtualNetwork.h
eb27b7ec10faf47a93fbc2863092cc667b05e252 01-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Fix routing rules.

Fix the rules in RouteController as per the latest iteration of the routing
design: http://go/android-multinetwork-routing. Changes include:

+ The legacy tables have to be global. So remove the UID being passed in to
modifyRoute() and remove the associated TODOs.

+ Add UID=0 rules to let the kernel access routes on privileged networks.

+ Add a UID=0 clause to the directly-connected hack, thus fixing the TODO.

+ Add the privileged_legacy table just above the legacy table, when overriding
the default network. (The same table remains added at the top of the rule
chain, to override VPNs, but only for CONNECTIVITY_INTERNAL-privileged apps).

Other cosmetic changes:
+ Update the names and values of the rule priorities.
+ Move the legacy table IDs to the .h file in anticipation of using them from
bugreport / dump commands.
+ Make 'action' the first parameter consistently.

Change-Id: I6634a19ddc8062b2ef55d926c7892fff8c586106
erver/NetworkController.cpp
erver/RouteController.cpp
erver/RouteController.h
cf891383224e420d99996f7e63728a7cc902415e 02-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Don't use %zu for uid_t. It's always unsigned int, so %u is correct.

Change-Id: I5be1d479b524495037c2aedc8336c794d2698914
erver/RouteController.cpp
1201e84ebda52d8d82e5385644e9de0923e61aa3 02-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Use %zu to printf size_t correctly on both 32-bit and 64-bit platforms.

Change-Id: I5223e574084fca47606b844d74a99a642c7d66be
erver/RouteController.cpp
b1425cc09f8a29350520db0d4f489331df5a689b 24-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Add UID range support to VPNs.

This adds the necessary routing rules.

Future CLs will add the ability to select the right netId for connect(),
setNetworkForSocket(), DNS resolutions, etc.

Bug: 15409918
Change-Id: I88a67660d49cecda834dd72ab947fbfed250f09d
erver/Android.mk
erver/CommandListener.cpp
erver/NetdConstants.h
erver/NetworkController.cpp
erver/NetworkController.h
erver/RouteController.cpp
erver/RouteController.h
erver/UidRanges.cpp
erver/UidRanges.h
erver/VirtualNetwork.cpp
erver/VirtualNetwork.h
4043f01f8e25f24246efadc710ad7440aab75529 23-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Introduce VPN support.

This change sets up the basic routing rules for VPNs. It doesn't yet handle UID
ranges (that are meant to apply to the VPN) correctly. That's forthcoming in
other CLs.

Bug: 15409918
Change-Id: I284de04f176dcf6ba702361de6a614266256d04e
erver/Android.mk
erver/CommandListener.cpp
erver/NetworkController.cpp
erver/NetworkController.h
erver/RouteController.cpp
erver/RouteController.h
erver/VirtualNetwork.cpp
erver/VirtualNetwork.h
f4f6c8de3f091be4b91a5a9d7f14e8882ec6d502 23-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Refactor: Encapsulate permissions and interfaces into a Network class.

Currently, there's a lot of logic in NetworkController surrounding events such
as interface addition/removal, network creation/destruction and default network
change, because these events are interwined. For example, adding an interface
means also adding a corresponding default network rule if the interface is being
added to the current default network.

When we introduce VPNs into this mix, things will get hairy real quick for all
this logic in NetworkController.

In this refactor, we introduce an abstract base class Network which supports
adding and removing interfaces. The main concrete implementation of this is
PhysicalNetwork, which allows setting permissions and "default network" state.

Since we've moved network permissions into the above class, and user permissions
into NetworkController, PermissionsController is unused and has been removed.

Also fix a few bugs in RouteController:
+ Use uidEnd correctly.
+ Check for all error cases in inet_pton.
+ Check the return value of android_fork_execvp() correctly.
+ The "return cmd1() && cmd2()" pattern is wrong. Rewrite that code.

Also (non-functional changes):
+ Remove instantiations of RouteController. It has static methods only.
+ Reorder some blocks in CommandListener so that the most frequent commands are
checked first.
+ Remove unused paramError() and clearNetworkPreference().
+ Change all return codes to int (negative errno) wherever applicable.
+ Add WARN_UNUSED_RESULT everywhere.
+ Cleanup some style in RouteController and NetworkController.
+ Use uid_t instead of unsigned for user IDs.
+ Add clearer log messages at the source of failures.
+ Add a check for when fwmark bits are set without corresponding mask bits.

Bug: 15409918

Change-Id: Ibba78b0850160f9f3d17d476f16331a6db0025d1
erver/Android.mk
erver/CommandListener.cpp
erver/CommandListener.h
erver/DnsProxyListener.cpp
erver/DnsProxyListener.h
erver/FwmarkServer.cpp
erver/FwmarkServer.h
erver/NetdConstants.h
erver/Network.cpp
erver/Network.h
erver/NetworkController.cpp
erver/NetworkController.h
erver/PermissionsController.cpp
erver/PermissionsController.h
erver/PhysicalNetwork.cpp
erver/PhysicalNetwork.h
erver/RouteController.cpp
erver/RouteController.h
erver/main.cpp
1077d298655efa7755925e788d49a73e9db10afc 27-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Don't fail when adding a duplicate legacy route.

This only affects calls to requestRouteToHost() by apps. We still fail if the
framework itself tries to add a non-legacy duplicate route, since the framework
should know better (we can consider relaxing that too in the future).

Bug: 15925532
Change-Id: I9ee434277e462d570f88e6fe63a096e5ae41eee9
erver/RouteController.cpp
72723683be57b6d562dc96cde30cc33cc96b3e82 26-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Convert rta_* and fra_* variable names to camelCase.

Change-Id: I0ca539ac4c54bb71b033f288fb4229afd71b7989
erver/RouteController.cpp
5965651602fb8373b75b6ae2d59c6a4d753f2f49 24-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Support adding and removing UID rules via netlink.

Change-Id: Idae13bceda869261689260759084b8d6ef1ff639
erver/RouteController.cpp
96f261e8b28048b8cb48f5a4e81822c73bb813f4 23-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Pass rule modification errors back to CommandListener.

Change-Id: If01334dccad8b6230648713a57fd58be180ac66b
erver/CommandListener.cpp
erver/NetworkController.cpp
erver/NetworkController.h
erver/RouteController.cpp
erver/RouteController.h
4753afd79e130d5f1c888f549c36b4da92dbe680 20-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Use netlink to add/delete rules as well as routes.

Also change the indentation of the rtattrs used in modifyIpRoute
to make it easier to see what attributes are being used and in
what sequence.

This change does not yet pass the errors back to CommandListener;
that is done in the next change in the series.

Change-Id: Ib2e174386c63cb0647d838d9c7d731cd6df39c4f
erver/RouteController.cpp
7f972fb1cd3c26af76779a7a3220b9cf5fb63a0a 25-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Unrevert the 'revert the "talk to netlink directly" change.'

http://ag/486277 was reverted in http://ag/491263 and is being unreverted in
this change. The bug in the original CL was a typo ("interface" instead of the
desired "ifindex"), which is now fixed.

Bug: 15840054
Change-Id: If66987c74cc86e9ba4f7a35d36f0a39afe939a68
erver/RouteController.cpp
ab359feb1a4d3a1898e32a7da47dcde3da4c1ed6 25-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Temporarily revert the "talk to netlink directly" change.

The change being reverted is http://ag/486277. Instead, use /sbin/ip again. The
code to talk to netlink fails on volantis. I.e., instead of this:
$ ip route show table 1006
default via 100.110.191.254 dev wlan0
100.110.128.0/18 dev wlan0 scope link
we end up with this:
$ ip route show table 1006
default dev wlan0 proto static
100.110.128.0/18 dev wlan0 proto static
Notice the lack of the nexthop and the addition of "proto static". I think the
netlink message is somehow not properly aligned on volantis, causing the kernel
to misinterpret it.

Bug: 15840054
Change-Id: Ief60473e337410f7cb35890de0a5a74a21723a41
erver/RouteController.cpp
7b64cdee0f468a5b66ae2439f84364815ae9a795 23-Jun-2014 Sasha Levitskiy <sanek@google.com> Netd: Interface controller: Demote a log message severity from warning to verbose.

Change-Id: Ia8b2e6a0b039c2bda418a5f7138c0aac6b6c643b
Signed-off-by: Sasha Levitskiy <sanek@google.com>
erver/InterfaceController.cpp
6c519f530eee2fd4438b237e157c0b5db25e4ed8 23-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Merge "Pass route add/delete errors back to CommandListener."
3a069e6a76752a0ee73c60f276ae362d1c01467f 22-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Return negative errno (instead of positive) on failure.

http://ag/489245 changed some return values from bools to errno values. However,
in forthcoming CLs, @lorenzo uses the convention of negative errno to indicate
failure. So, be consistent with that style.

Change-Id: I3eac8f142c36a2e779cda289c07ee374c49e2f6b
lient/FwmarkClient.cpp
lient/FwmarkClient.h
lient/NetdClient.cpp
nclude/NetdClient.h
erver/FwmarkServer.cpp
erver/FwmarkServer.h
f7fc8eccb0a6a4fbca4cafdf53f5c167c8f1d755 17-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Pass route add/delete errors back to CommandListener.

Change-Id: Id1d6d578963080e141f71bc1303801fc53bce40a
erver/CommandListener.cpp
erver/NetworkController.cpp
erver/NetworkController.h
erver/RouteController.cpp
erver/RouteController.h
ba25df989b48f36b784ad39307a49a4fd9c3fd66 17-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Use native netlink code instead of /sbin/ip to manipulate routes

Shelling out to /sbin/ip is slow, and more importantly it does
not preserve the error messages returned by the kernel when
adding or deleting a route fails. Instead, use netlink directly.

This change does not yet pass the errors back to CommandListener;
that is done in the next change in the series.

Change-Id: I5ad3c8583580857be6386a620ff5c4f3872d685b
erver/NetdConstants.cpp
erver/NetdConstants.h
erver/RouteController.cpp
bd0f224f077264f21fa858b7a93062e3b8564006 12-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Notify network observers of route changes.

This reverts commit 20d3f5e856a38ef22851e32d7f9b6a7cd02eb459.

Bug: 9180552
Change-Id: I004448e2f0c731f6ca2c6d3535dc4dd51a622293
erver/NetlinkHandler.cpp
erver/NetlinkHandler.h
erver/NetlinkManager.cpp
erver/ResponseCode.h
4d4c8b7e294d845103ecb10f968713717a3e6406 20-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Add getNetworkForSocket().

This doesn't require a roundtrip to netd, since anybody can read the SO_MARK.

Change-Id: I51dd17725c4534cb0d5dbc8e93e844e6a7847959
lient/NetdClient.cpp
nclude/Fwmark.h
nclude/NetdClient.h
nclude/Permission.h
erver/Fwmark.h
erver/Permission.h
31f4210e6fc5c9b749468a2af0bac94992352010 20-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Return errors explicitly instead of using errno.

Change-Id: Ia29f500e747a8c72d13a8f38c3b08c319c8c029a
lient/FwmarkClient.cpp
lient/FwmarkClient.h
lient/NetdClient.cpp
nclude/NetdClient.h
e3a5ef5eff7b4c9741bb80e42af46a59b5d23b7f 20-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Merge "Add a client API to protect a socket from VPNs."
a0817988748a4643041495751997ba9249b8c5ea 20-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Merge "Revert "Notify network observers of route changes.""
20d3f5e856a38ef22851e32d7f9b6a7cd02eb459 20-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Revert "Notify network observers of route changes."

This reverts commit d2f23fb6285000831f14cacc16881d96f6046c33.

Change-Id: Ifabbc6848ab33842461465fccb9886863a08aec6
erver/NetlinkHandler.cpp
erver/NetlinkHandler.h
erver/NetlinkManager.cpp
erver/ResponseCode.h
d2f23fb6285000831f14cacc16881d96f6046c33 12-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Notify network observers of route changes.

Bug: 9180552
Change-Id: Ic23025e4d7cb4e58ae59017777267ac45f00b434
erver/NetlinkHandler.cpp
erver/NetlinkHandler.h
erver/NetlinkManager.cpp
erver/ResponseCode.h
eb791da31a237be2a2045c21cef5681ecb4179d2 20-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Merge "Flush both IPv4 and IPv6 routes."
357e5629bb4c745296ab40340ec8679372337155 17-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Flush both IPv4 and IPv6 routes.

The current code unintentionally flushes only IPv4 routes
because it reuses a function that is normally used to add and
remove routes (where the IP version is implicitly specified by
the route to add or remove).

Instead of fixing the runIpRouteCommand function, add a new
flushIpRoutes function because runIpRouteCommand will be
replaced by a netlink implementation in an upcoming CL.

Change-Id: Ie96ae4124baca3edb8e0d0841e7abadb6b3ee9ab
erver/RouteController.cpp
bb3944c2bc2e41984864a604bf9743cfe8e0053f 20-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Merge "Notify network observers of route changes."
69261cb65186e27dfbdc1e3eec796437f9968ff9 20-Jun-2014 JP Abgrall <jpa@google.com> server: check interface names in RPC arguments for validity

This patch introduces a method isIfaceName that checks interface
names from various RPCs for validity before e.g. using them as
part of iptables arguments or in filenames.

All of these RPC calls can only be called from applications
with at least the CONNECTIVITY_INTERNAL permission in recent
Android versions, so the impact of the missing checks luckily
isn't very high.

Orig-Author: Jann Horn <jann@thejh.net>

Change-Id: I80df8d745a3de99ad02d6649f0d10562c81f6b98
Signed-off-by: JP Abgrall <jpa@google.com>
erver/BandwidthController.cpp
erver/BandwidthController.h
erver/ClatdController.cpp
erver/FirewallController.cpp
erver/IdletimerController.cpp
erver/InterfaceController.cpp
erver/NatController.cpp
erver/NatController.h
erver/NetdConstants.cpp
erver/NetdConstants.h
erver/SecondaryTableController.cpp
erver/TetherController.cpp
d794e580dbe1a8b4192850b0e117654401514af8 19-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Add a client API to protect a socket from VPNs.

The server side hasn't been implemented yet (see FwmarkServer.cpp).

A UID can only be in a single VPN at any time, so there's no need
to specify a netId or vpnId.

Change-Id: Ie9c4590a9900e1ebf28418c4b9c4760cc0a5501a
lient/NetdClient.cpp
nclude/NetdClient.h
a561e121c724e9163b2e256e15eef660e3a326da 12-Jun-2014 Paul Jensen <pauljensen@google.com> Cache interface indices in case interfaces go away.

Without caching them netd will fail to remove rules and routes,
for example, when the Bluetooth reverse-tether interface ("bt-pan")
goes away.

bug:15407087

Change-Id: I99fcf00f9645a0b029455516a705b70110f62ff6
erver/NetworkController.cpp
erver/RouteController.cpp
5ad1c281da21ebe1863fbad50f7c20dce4f08512 13-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Merge "Pass a socket mark to clatd so it can bind to its network."
45d3dd0ad99d566ea589d9d5d37102ef35ca8fb2 09-Jun-2014 Lorenzo Colitti <lorenzo@google.com> Pass a socket mark to clatd so it can bind to its network.

Bug: 15340961
Change-Id: If15e90cbd5526f6c8fd839d4d009846d64d9e77a
erver/ClatdController.cpp
erver/Fwmark.h
bca6dbdfc9a193e3c3e4a6801f3a1bee18c5d6df 12-Jun-2014 Paul Jensen <pauljensen@google.com> am b72f6d71: (-s ours) DO NOT MERGE: Fix use-after-free of interface name during network destruction.

* commit 'b72f6d71840afeb1923f64f8c44417f4f208c282':
DO NOT MERGE: Fix use-after-free of interface name during network destruction.
b72f6d71840afeb1923f64f8c44417f4f208c282 11-Jun-2014 Paul Jensen <pauljensen@google.com> DO NOT MERGE: Fix use-after-free of interface name during network destruction.

bug:15560990

Change-Id: I899827c4f50847a3a60b6359f829bee5d6eb4f00
(cherry picked from commit 6ff16785ae1f67f44a73ad00d6c86690af6772d2)
erver/NetworkController.cpp
6ff16785ae1f67f44a73ad00d6c86690af6772d2 11-Jun-2014 Paul Jensen <pauljensen@google.com> Fix use-after-free of interface name during network destruction.

bug:15560990

Change-Id: I899827c4f50847a3a60b6359f829bee5d6eb4f00
erver/NetworkController.cpp
3fea54b4de8b09f299fe8f2b184997f560986738 06-Jun-2014 Sreeram Ramachandran <sreeram@google.com> am 41417388: (-s ours) Use AF_INET sockets when checking netIds in setNetworkFor{Process,Resolv}(). DO NOT MERGE

* commit '414173882a87ded2fdd4f5181cd7dff3842a8917':
Use AF_INET sockets when checking netIds in setNetworkFor{Process,Resolv}(). DO NOT MERGE
1924a6cfc3d1fd8641aa9ebea3a6e1babae0495e 05-Jun-2014 Dan Albert <danalbert@google.com> am d42cdf50: am 437eb9c3: Merge "Changes uses of index() to strchr()"

* commit 'd42cdf50ab883acb74b17d63646f0228d881df3c':
Changes uses of index() to strchr()
d42cdf50ab883acb74b17d63646f0228d881df3c 05-Jun-2014 Dan Albert <danalbert@google.com> am 437eb9c3: Merge "Changes uses of index() to strchr()"

* commit '437eb9c3092c96c1828e326edb6574090fe37aaa':
Changes uses of index() to strchr()
437eb9c3092c96c1828e326edb6574090fe37aaa 05-Jun-2014 Dan Albert <danalbert@google.com> Merge "Changes uses of index() to strchr()"
602b80d628692efc2ce020800a8fc8cd82834ad7 05-Jun-2014 Dan Albert <danalbert@google.com> Changes uses of index() to strchr()

Bionic is geting rid of index() because it was removed from POSIX 2008.

Change-Id: I182523734f372d1c6ed052b1373422332587f8ff
dc.c
9fa2b130d86fa74eefdb847cf9694059205fd4cb 03-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Use std::atomic<> instead of volatile sig_atomic_t.

std::atomic<> comes with true load/store barriers, so it's preferable.

Change-Id: Ife47b0e404f41aa74aeb168befd1ff4a6603f3ed
lient/Android.mk
lient/NetdClient.cpp
ddabf95e3ef44d7da607de7b0186ef4eb0690ecf 03-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Remove unnecessary includes.

Neither of these actually does anything.

Change-Id: I82ee09a4565a8e8e4dc5f54f278bf83e002d7387
erver/Android.mk
8ad8766b4d1f0c07fb36a6412d180fbff66c31c9 03-Jun-2014 Paul Jensen <pauljensen@google.com> Merge "Pass NetID to clatd as a command line argument."
84c1d035fdef996602ab8878d952c4fcb1f6963d 30-May-2014 Paul Jensen <pauljensen@google.com> Pass NetID to clatd as a command line argument.

Change-Id: I77a47b24e68c7786f790974f05787a40a4934af5
erver/ClatdController.cpp
erver/ClatdController.h
erver/CommandListener.cpp
414173882a87ded2fdd4f5181cd7dff3842a8917 31-May-2014 Sreeram Ramachandran <sreeram@google.com> Use AF_INET sockets when checking netIds in setNetworkFor{Process,Resolv}(). DO NOT MERGE

AF_UNIX sockets don't need to be marked, so we don't give netd the permission to
operate on them (cf: netd.te). I.e., netd doesn't expect to receive them.

Make sure that the creation of the AF_INET socket doesn't trigger another
wasteful check with netd by calling the libc version directly.

Bug: 13885501
Change-Id: I6b549232e57cacd47501edcefa4c0b4b79df9da0
(cherry picked from commit 2756045bebaac342f7cb70dad11519f896d44833)
lient/NetdClient.cpp
2756045bebaac342f7cb70dad11519f896d44833 31-May-2014 Sreeram Ramachandran <sreeram@google.com> Use AF_INET sockets when checking netIds in setNetworkFor{Process,Resolv}().

AF_UNIX sockets don't need to be marked, so we don't give netd the permission to
operate on them (cf: netd.te). I.e., netd doesn't expect to receive them.

Make sure that the creation of the AF_INET socket doesn't trigger another
wasteful check with netd by calling the libc version directly.

Bug: 13885501
Change-Id: I6b549232e57cacd47501edcefa4c0b4b79df9da0
lient/NetdClient.cpp
ac19883dd50d5310d1fddf996ee227075a103ecb 31-May-2014 Sreeram Ramachandran <sreeram@google.com> Fix build.

Change-Id: If170e46ff92c6a972bc1c2d838b1ac0eea6e23de
erver/RouteController.cpp
9a4c1128b274ee2a6ffab3d50d08aaf0bc2fb2ff 30-May-2014 Sreeram Ramachandran <sreeram@google.com> am 82eab785: Support legacy routes added by apps via ensureRouteToHost().

* commit '82eab785bd5cb2eff0a263f5b0dcde13e9139588':
Support legacy routes added by apps via ensureRouteToHost().
82eab785bd5cb2eff0a263f5b0dcde13e9139588 22-May-2014 Sreeram Ramachandran <sreeram@google.com> Support legacy routes added by apps via ensureRouteToHost().

This adds the routes to two fixed tables:
+ LEGACY, which has higher priority than other non-explicit lookup tables
(per-network and default network).
+ PRIVILEGED_LEGACY, available only to system apps and has higher priority than
VPNs (system apps are those with the CONNECTIVITY_INTERNAL permission).

This will be changed to per-UID tables once the kernel supports UID-based
routing, so that these legacy routes are scoped to each app and not global.

Also, fix a TODO: The framework (as of http://ag/471599) will not set the
gateway argument if it's actually a direct-connected route.

Change-Id: I0ee1ca89fdc859d75a89021ca8c1902811b1e4a9
(cherry picked from commit 38b7af1f2cb9579895465fabc37865f5dadcac25)
erver/CommandListener.cpp
erver/NetworkController.cpp
erver/NetworkController.h
erver/RouteController.cpp
erver/RouteController.h
bfe8e77344c713844dbb40b14999f50a1e2a2142 30-May-2014 Lorenzo Colitti <lorenzo@google.com> am ce8f583f: Set errno in NetworkController commands.

* commit 'ce8f583ff6620a19602d3c4604557e1b1501cafa':
Set errno in NetworkController commands.
a67870d24c51f01587c603d5048350d36163dee0 30-May-2014 The Android Automerger <android-build@google.com> am a5d68758: merge in master-release history after reset to ec00884cac216d1cb79556ca23b21ce55e35af3e

* commit 'a5d6875887a63797711093a169e7ef19c5a1ab3b':
Fix for DNS resolutions when there is no default network set yet. We need to determine the actual netId to use prior to comparing it against the default netId. Also initialize the default network variable.
56afacf838d24cf8e54d2cf0d8ab9182ab704125 29-May-2014 Sreeram Ramachandran <sreeram@google.com> Turn on C++11 and make all warnings into errors.

As a consequence:
+ Comment out the names of all unused parameters.
+ Remove all unused variables and functions.

In server/Android.mk, there are a couple of non-trivial changes:
+ Use libcxx instead of stlport. This is needed to fix a bunch of errors due to
specifying -std=c++11.
+ LOCAL_SHARED_LIBRARIES is sorted. Technically, the order in which libraries
are listed has an effect on linking, but nobody should be doing such brittle
things anyway.

Change-Id: I0aff5b745e04609da23144d0e8be4c5694321b8b
lient/Android.mk
erver/Android.mk
erver/BandwidthController.cpp
erver/CommandListener.cpp
erver/Fwmark.h
erver/MDnsSdListener.cpp
erver/MDnsSdListener.h
erver/NatController.cpp
erver/NetlinkHandler.cpp
erver/NetlinkManager.h
erver/RouteController.cpp
erver/SoftapController.cpp
erver/TetherController.cpp
erver/main.cpp
38b7af1f2cb9579895465fabc37865f5dadcac25 22-May-2014 Sreeram Ramachandran <sreeram@google.com> Support legacy routes added by apps via ensureRouteToHost().

This adds the routes to two fixed tables:
+ LEGACY, which has higher priority than other non-explicit lookup tables
(per-network and default network).
+ PRIVILEGED_LEGACY, available only to system apps and has higher priority than
VPNs (system apps are those with the CONNECTIVITY_INTERNAL permission).

This will be changed to per-UID tables once the kernel supports UID-based
routing, so that these legacy routes are scoped to each app and not global.

Also, fix a TODO: The framework (as of http://ag/471599) will not set the
gateway argument if it's actually a direct-connected route.

Change-Id: I0ee1ca89fdc859d75a89021ca8c1902811b1e4a9
erver/CommandListener.cpp
erver/NetworkController.cpp
erver/NetworkController.h
erver/RouteController.cpp
erver/RouteController.h
ce8f583ff6620a19602d3c4604557e1b1501cafa 28-May-2014 Lorenzo Colitti <lorenzo@google.com> Set errno in NetworkController commands.

Set errno in the NetworkController functions that are called by
CommandListener and where failure causes an operationError. This
is because operationError always appends errno to its messages,
and

"400 481 addInterfaceToNetwork() failed (Device or resource busy)"

is more useful than:

"400 481 addInterfaceToNetwork() failed (Success)"

We already call ALOGE to put descriptive messages in the system
log, but the bugreport already conveniently aggregates all netd
commands in one place in the network_management service dump, and
it would help if the errno in those messages were accurate.

Unfortunately many of the route and iptables commands shell out
to /sbin/ip and we can't return meaningful values, but we'll
fix that when (if?) we replace that with a proper netlink
implementation.

Bug: 15316764
Change-Id: Ia47f451029d611491aa72bca602de77333f2c6a0
erver/NetworkController.cpp
erver/SecondaryTableController.cpp
a5d6875887a63797711093a169e7ef19c5a1ab3b 22-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to ec00884cac216d1cb79556ca23b21ce55e35af3e
7971a84be3e6cd8bf3e4dae31f307a7fb13fb302 22-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to ec00884cac216d1cb79556ca23b21ce55e35af3e
ec00884cac216d1cb79556ca23b21ce55e35af3e 21-May-2014 Sreeram Ramachandran <sreeram@google.com> Implement the "select network" fwmark command.

Change-Id: Id4a49eb288b18022d53014d1ae2211ed7d1099a6
erver/Fwmark.h
erver/FwmarkServer.cpp
72604075e74af459fb4637404fbf030422c6b6b6 21-May-2014 Sreeram Ramachandran <sreeram@google.com> Rework the determination of a "valid network".

+ isNetIdValid() doesn't make much sense. What we want is whether the netId has
actually been created (via createNetwork()).
+ It isn't an error to call deleteNetwork() or setDefaultNetwork() even when
there are no interfaces assigned to the network.
+ Secure all accesses to the maps in PermissionsController with locks; they are
called from many threads (CommandListener, DnsProxyListener and FwmarkServer).
+ Remove the redundant mIfaceNetidMap.
+ Minor cosmetic changes to things such as #includes and log messages.

Change-Id: Ieb154589b24f00ba8067eaaec4def3534aec4923
erver/CommandListener.cpp
erver/NetworkController.cpp
erver/NetworkController.h
erver/PermissionsController.cpp
erver/PermissionsController.h
erver/RouteController.cpp
erver/RouteController.h
5fc275794ab41d110abbdb7683ed9db45918985f 21-May-2014 Sreeram Ramachandran <sreeram@google.com> Mark sockets on creation (socket()) and accept4().

Continued from: https://android-review.git.corp.google.com/#/c/95094/

Change-Id: Ib0b8f5d7c5013b91eae6bbc3847852eb355c7714
lient/FwmarkClient.cpp
lient/FwmarkClient.h
lient/NetdClient.cpp
efbe05d203f2f1cc3c24ddc111be159a1ff1f292 21-May-2014 Sreeram Ramachandran <sreeram@google.com> New network selection APIs.

Continued from: https://android-review.git.corp.google.com/#/c/94977/

Change-Id: Ie0576888f50a8ce91bbb0a4794708b406eb0aa35
lient/Android.mk
lient/NetdClient.cpp
nclude/FwmarkCommand.h
nclude/NetdClient.h
erver/FwmarkServer.cpp
f4cfad361175a7f9ccf4d41e76a9b289c3c3da22 21-May-2014 Sreeram Ramachandran <sreeram@google.com> Move netd_client into netd.

Change-Id: Ie4b6b303225c93f2448a503d6ea9cebb552cbad5
ndroid.mk
andwidthController.cpp
andwidthController.h
latdController.cpp
latdController.h
leanSpec.mk
ommandListener.cpp
ommandListener.h
nsProxyListener.cpp
nsProxyListener.h
irewallController.cpp
irewallController.h
wmark.h
wmarkServer.cpp
wmarkServer.h
dletimerController.cpp
dletimerController.h
nterfaceController.cpp
nterfaceController.h
ist.h
DnsSdListener.cpp
DnsSdListener.h
atController.cpp
atController.h
etdCommand.cpp
etdCommand.h
etdConstants.cpp
etdConstants.h
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.cpp
etlinkManager.h
etworkController.cpp
etworkController.h
ermission.cpp
ermission.h
ermissionsController.cpp
ermissionsController.h
ppController.cpp
ppController.h
esolverController.cpp
esolverController.h
esponseCode.h
outeController.cpp
outeController.h
econdaryTableController.cpp
econdaryTableController.h
oftapController.cpp
oftapController.h
etherController.cpp
etherController.h
lient/Android.mk
lient/FwmarkClient.cpp
lient/FwmarkClient.h
lient/NetdClient.cpp
nclude/FwmarkCommand.h
ain.cpp
dc.c
em_iptables_hook.cpp
em_iptables_hook.h
erver/Android.mk
erver/BandwidthController.cpp
erver/BandwidthController.h
erver/ClatdController.cpp
erver/ClatdController.h
erver/CleanSpec.mk
erver/CommandListener.cpp
erver/CommandListener.h
erver/DnsProxyListener.cpp
erver/DnsProxyListener.h
erver/FirewallController.cpp
erver/FirewallController.h
erver/Fwmark.h
erver/FwmarkServer.cpp
erver/FwmarkServer.h
erver/IdletimerController.cpp
erver/IdletimerController.h
erver/InterfaceController.cpp
erver/InterfaceController.h
erver/List.h
erver/MDnsSdListener.cpp
erver/MDnsSdListener.h
erver/NatController.cpp
erver/NatController.h
erver/NetdCommand.cpp
erver/NetdCommand.h
erver/NetdConstants.cpp
erver/NetdConstants.h
erver/NetlinkHandler.cpp
erver/NetlinkHandler.h
erver/NetlinkManager.cpp
erver/NetlinkManager.h
erver/NetworkController.cpp
erver/NetworkController.h
erver/Permission.cpp
erver/Permission.h
erver/PermissionsController.cpp
erver/PermissionsController.h
erver/PppController.cpp
erver/PppController.h
erver/ResolverController.cpp
erver/ResolverController.h
erver/ResponseCode.h
erver/RouteController.cpp
erver/RouteController.h
erver/SecondaryTableController.cpp
erver/SecondaryTableController.h
erver/SoftapController.cpp
erver/SoftapController.h
erver/TetherController.cpp
erver/TetherController.h
erver/main.cpp
erver/ndc.c
erver/oem_iptables_hook.cpp
erver/oem_iptables_hook.h
7591e3e55036479b0350ec397fd9014270df9f23 21-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 5ff58d494a5ddf7e544adc77590300f04daf8e31
5ffe0c941c4d4138c43222578e71182993b2e2a6 20-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 5ff58d494a5ddf7e544adc77590300f04daf8e31
0e6c71b5c2ad365dc843cd159c1b7cb7d93dc46c 19-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 5ff58d494a5ddf7e544adc77590300f04daf8e31
8ead87d2d5852ceb4561564c8edb079cb78b7850 18-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 5ff58d494a5ddf7e544adc77590300f04daf8e31
97c8e3822aaafa8934b1f02d51b0c970a8c75e37 17-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 5ff58d494a5ddf7e544adc77590300f04daf8e31
8743a5dbb11a408ecb33587956331978dae47709 15-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 5ff58d494a5ddf7e544adc77590300f04daf8e31
5ff58d494a5ddf7e544adc77590300f04daf8e31 14-May-2014 Sreeram Ramachandran <sreeram@google.com> Fix build by using the right type (socklen_t instead of int).

Change-Id: Ia4a56ef679269755a3787408821c0cda6aec9420
wmarkServer.cpp
4f53662aeb33975b5317bc3e5882fe730804ede8 13-May-2014 Sreeram Ramachandran <sreeram@google.com> Mark sockets on accept().

The kernel marks the netId into the accepted socket, so we just set the socket
owner's permission bits here in userspace.

We also check the permissions required by the network and return an error if
they are not satisfied. This avoids the "half-open" problem where an app listens
on all networks (interfaces) with bind(0), and receives an incoming connection
on a privileged interface that it can't send responses over.

(cherry picked from commit 920747a009efbb815465d980ec6a918531e74e9f)

Change-Id: I5d09be413cf720fbed905f96313b007997ada76c
wmarkServer.cpp
ermissionsController.cpp
ermissionsController.h
030b36ecb93b72ca9a3797c10f0a82ebf8c6a618 12-May-2014 Sreeram Ramachandran <sreeram@google.com> Introduce fwmarkd: a service to set the fwmark of sockets.

At connect(), mark sockets with the default network's netId.

(cherry picked from commit 361154d38016ebeaabf1bb75534dabbacf5de5fa)

Change-Id: Ib6198e19dbc306521a26fcecfdf6e8424d163fc9
ndroid.mk
wmarkServer.cpp
wmarkServer.h
ain.cpp
86686308ce65c0a3daf43b2b86f1d2bbc341b366 14-May-2014 Sreeram Ramachandran <sreeram@google.com> Remove redundant cache deletion.

This was added in http://ag/465643 as part of the merge from
master-multinetwork-dev to master, but was unnecessary, since it was already
added to NetworkController.cpp in http://ag/465593.

Change-Id: Ic9a56a5276ca6d58cf5fec60f89f30c2285aa35e
ommandListener.cpp
574e6335424e6fed1e22160be78fb8f4ae481a49 14-May-2014 Sreeram Ramachandran <sreeram@google.com> Initialize mDefaultNetId.

This was accidentally dropped in the merge from master-multinetwork-dev to
master, in http://ag/465644.

Change-Id: I0699604923477e6b19dfc8c70a84c50a79fe3d72
etworkController.cpp
e291496fbf3f59d36b6b131072e924ebdc485229 14-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 3ced06906759b3ce252e114fcc9c98fa36228911
a146c2e163054743bf7fdf7d68b0dd294df06e7f 14-May-2014 Lorenzo Colitti <lorenzo@google.com> Address TODO to uncomment _resolv_delete_cache_for_net.

Change-Id: I581e6f2afaac25db04a87ac70703a02a669b5edf
ommandListener.cpp
etworkController.cpp
122f581eb16e06c70cbbc40bd40995775075151f 12-May-2014 Sreeram Ramachandran <sreeram@google.com> Refactor the fwmark stuff to use an explicit union of bit-fields.

This is a pure refactor. There's no effect on any functionality.

Change-Id: I99d1f3fb76781cf84f67c2dff44eaf3a2cf50a9f
ndroid.mk
nsProxyListener.cpp
wmark.cpp
wmark.h
outeController.cpp
ae37e8a4f42b658d5aaf43f312f063944b4aeecb 28-Apr-2014 Paul Jensen <pauljensen@google.com> Separate network and interface addition/removal netd APIs.
This should facilitate stacked interfaces (i.e. clatd).

Change-Id: Ib3e7a4d3847ef6ec4449451f6da42e75959baa4f
ommandListener.cpp
etworkController.cpp
etworkController.h
outeController.cpp
outeController.h
fd6424fdf2cd0516a6c95288610e323dbdfe84ff 25-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Ignore failure when adding directly-connected routes to the main table.

Change-Id: I12f65cdfbe2285820bd24b047f794ec9b9b5110f
outeController.cpp
a79f6182a338621a32f350d7c2985c6872cccf84 25-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Fixes for stupid mistakes (by me).

+ Only remove netId/permission after doing everything that references them.
+ Return success/failure correctly based on return value of fork/exec.

Conflicts:
NetworkController.cpp

Change-Id: Iddb8ccdffc104ffed1058ecc2421006beebd568d
etworkController.cpp
outeController.cpp
c92133732378aae815120c39edd62a7b4eb773b3 16-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Add directly-connected routes to the main table.

Change-Id: I545555d273ea9d321eab08fef12a32ca17e33dff
ommandListener.cpp
outeController.cpp
7dd69a1b0b95e67c8b939884476f2cf888026eb7 17-Apr-2014 Paul Jensen <pauljensen@google.com> Use proper socket mark for DNS resolution.

Change-Id: I531ff0fbce6e7172b82bc2d4c7406a324603eb8a
ommandListener.h
nsProxyListener.cpp
nsProxyListener.h
ain.cpp
35c77e32b27694a138e9a7877b9a5b474441c58b 10-Apr-2014 Paul Jensen <pauljensen@google.com> netd: Accept NetId instead of interface name in DNS resolver commands.

Conflicts:
DnsProxyListener.cpp
NetworkController.cpp
NetworkController.h

Change-Id: Ic82b73de6f50d39d56c5e1a32f5b1f3ebb80bb7d
ommandListener.cpp
nsProxyListener.cpp
etworkController.cpp
etworkController.h
econdaryTableController.cpp
econdaryTableController.h
f2611ae597cf213c91fa61b9ba84d4138a470db5 17-Apr-2014 Paul Jensen <pauljensen@google.com> When deleteing a network also delete the resolver cache for that
network.

Change-Id: I99d058bafea5de743e56075dbed74031da4df63f
ommandListener.cpp
3ced06906759b3ce252e114fcc9c98fa36228911 18-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Cosmetic: Move logic from CommandListener into NetworkController.

CommandListener should just unmarshal params, and delegate all functional logic
to NetworkController (or other such classes). So, for example, if you call
destroyNetwork() directly from a unit test, you should get the same effect as if
you sent a "network destroy" command to CommandListener.

(cherry picked from commit f7743bf18672d654e79565e85c7d3770e2f0f26c)

Change-Id: Ic61ae9141e2eea95394a3a38e30a72fe964cdc81
etworkController.cpp
8fe9c8e0a2b1c5cd2a34720efaccc641d9ab8fb6 16-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Update the "lookup main" rule to include a fwmark clause.

If a packet is marked with a non-zero NetId, and doesn't find a route in its
per-network table, it will now not match the main table rule, and so will
fallthrough to the "unreachable" rule, resulting in ENETUNREACH, as desired.

If a packet has a zero NetId (e.g.: sent on an unconnected UDP socket), it will
find the "default network" rule first, which should have a default route, so it
will never need to fall through any further to the main table.

This makes the main table effectively unused for all normal routing lookups.

Only the kernel will still use this table, when trying to find a directly
connected route to validate the nexthop when a route is added anywhere.

(cherry picked from commit 4594dbba433dadba953c1c7b43fdd99e77fb1f2b)

Change-Id: Ib0784ff0848854be0575c64a59bbd0a4d3bf93e0
ommandListener.cpp
outeController.cpp
outeController.h
92b66c4990b4a0ab608aa9c31da946f36085203b 15-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Flush (delete) routing tables when destroying a network.

(cherry picked from commit 7ee2c3fe24f9a643584ddf5f759a7acb73e35e8d)

Change-Id: I1b222b474b1ae7a551250f8f02d7900c493b5b16
outeController.cpp
7619e1bbebdfe643c35ee6be4ac054f5255f0706 15-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Implement the "network route add/remove" API.

(cherry picked from commit 909c52248a4ad832548c5feb5e9a58323e30ab7b)

Change-Id: Idb09b0c22a3a519dda232995ced406e470ab9768
ommandListener.cpp
etworkController.cpp
etworkController.h
outeController.cpp
outeController.h
9c0d313de6a3157fadd3b52a9927c77216ca435e 11-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Implement network default set/clear.

(cherry picked from commit 4cc7df247a7ec67da3b5edfb9356077fbbf0150c)

Change-Id: Ib35d54816884c6a6ba28231c9b1f54e362d1d16a
ommandListener.cpp
etworkController.cpp
etworkController.h
outeController.cpp
outeController.h
379bd33f7640e2c4bef902be0ed6cb96378c8c2e 11-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Implement permissions set/clear for both networks and users.

(cherry picked from commit 47a0fa0ad402704b639fbc2868c55adc432bb6ea)

Change-Id: Ibb71025e1e2c72bd300fb7379d5ab54da4a6982e
ommandListener.cpp
wmark.cpp
etworkController.cpp
etworkController.h
ermission.h
ermissionsController.cpp
ermissionsController.h
outeController.cpp
outeController.h
a10ac3214f6a582b7fdb66acc43c702731e53d81 11-Apr-2014 Lorenzo Colitti <lorenzo@google.com> Move sprintf statements to getRouteTableForInterface.

(cherry picked from commit b45648ad5902e53f433615ab1a0268927b6a328e)

Change-Id: Ie0b2c3e3688285068b70e96d1153c0b105548a00
etdConstants.h
outeController.cpp
a01d6eff4316c6c10e81bd8d48ae85aa82b933e3 11-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Cleanup: Minor style fixes.

(cherry picked from commit 49d905456fd6cf730abdddb49df84d6032b0a419)

Change-Id: I199447f03ce33d79007e62e23ccf683ed4249f97
ommandListener.cpp
nterfaceController.cpp
nterfaceController.h
etworkController.h
outeController.cpp
a48118062412f16ae712bfc8c8a539d3b6a85e47 10-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Set kernel proc files for fwmark reflection and table numbers for RAs.

(cherry picked from commit 75992274574e91c9a17aad5b60f0c2b710cd31b9)

Change-Id: I5f0d759cb9b8590555af7f5503f00d3e455ece54
nterfaceController.cpp
nterfaceController.h
outeController.cpp
outeController.h
5c181bf8ca0c89bd9e3e6d8e40bac53d0ee7082f 07-Apr-2014 Sreeram Ramachandran <sreeram@google.com> Implement network create/destroy.

(cherry picked from commit 382fc20107aa38cca062f10b4bc05c47b6c7f191)

Change-Id: Id5f8df447d812c8e8cf03addbb5e70abdcdfceb9
ndroid.mk
ommandListener.cpp
ommandListener.h
wmark.cpp
wmark.h
etId.cpp
etId.h
etworkController.cpp
etworkController.h
ermission.cpp
ermission.h
ermissionsController.cpp
ermissionsController.h
outeController.cpp
outeController.h
d736d4b327bf35afc59b5cec110491fcdb9e2cbb 27-Mar-2014 Sreeram Ramachandran <sreeram@google.com> Introduce Netd APIs for multinetworks.

Just stubs for now. Implementation will follow in subsequent CLs.

Change-Id: I10a2e4aca594c10a26d58afb4c250141386d3f0f
(cherry picked from commit 0d5146bed37b4e5b6909617e5f958a66bfee1e48)
ndroid.mk
ommandListener.cpp
ommandListener.h
wmark.h
etId.cpp
etId.h
e2cd1ef2c425a0958e2c77133a8d2c0556a0acf3 13-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 978d30d0e046c971b37a6fc20480615f1c55f55c
0ee7f862080f9ea6656180af023a82b02c2edeff 12-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 978d30d0e046c971b37a6fc20480615f1c55f55c
cbaa297fce56896b50862f53e59d3ba358e52b37 11-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 978d30d0e046c971b37a6fc20480615f1c55f55c
013225af942665e0fc3c4903e0bf0aba53c6d081 10-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 978d30d0e046c971b37a6fc20480615f1c55f55c
f6085c601f91a750e5792ad4a2ef0a2d4e585de6 08-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 978d30d0e046c971b37a6fc20480615f1c55f55c
fb11fa089165840c838b2492c3dabf85c76027fe 07-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 978d30d0e046c971b37a6fc20480615f1c55f55c
1f985e93f84e260ea3319268114ad13c1fb15c7c 07-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 978d30d0e046c971b37a6fc20480615f1c55f55c
b8f81724e47947a2303f4b685dcbf5c51c168e25 06-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 978d30d0e046c971b37a6fc20480615f1c55f55c
613b23cf67034e85b25b470e340f6e83f7d912d9 05-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 978d30d0e046c971b37a6fc20480615f1c55f55c
b07a7d1641e80756092890c54665977cfb121424 04-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 978d30d0e046c971b37a6fc20480615f1c55f55c
4c830ad7548d79d2b1fb43aad933ad5618b5866b 03-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 978d30d0e046c971b37a6fc20480615f1c55f55c
978d30d0e046c971b37a6fc20480615f1c55f55c 02-May-2014 Nick Kralevich <nnk@google.com> am 551e5b47: am 553dc723: BandwidthController: validate interface / chain names

* commit '551e5b47a21294cf775f8effbb6f2bf34c664164':
BandwidthController: validate interface / chain names
551e5b47a21294cf775f8effbb6f2bf34c664164 02-May-2014 Nick Kralevich <nnk@google.com> am 553dc723: BandwidthController: validate interface / chain names

* commit '553dc723163798720bf59d452688ad0ae946b29e':
BandwidthController: validate interface / chain names
553dc723163798720bf59d452688ad0ae946b29e 01-May-2014 Nick Kralevich <nnk@google.com> BandwidthController: validate interface / chain names

Only allow alphanumeric, dashes, underscores, or colons in
interface and chain names. First character must be alphanumeric.

Bug: 14320836
Bug: 14323009
Change-Id: Ieac729719d0f9038f60c7afcb327f17d292d6ca6
(cherry picked from commit 0b2b9021ee27af2449c433fa13ed5c57e55dd816)
andwidthController.cpp
andwidthController.h
0b2b9021ee27af2449c433fa13ed5c57e55dd816 01-May-2014 Nick Kralevich <nnk@google.com> BandwidthController: validate interface / chain names

Only allow alphanumeric, dashes, underscores, or colons in
interface and chain names. First character must be alphanumeric.

Bug: 14320836
Bug: 14323009
Change-Id: Ieac729719d0f9038f60c7afcb327f17d292d6ca6
andwidthController.cpp
andwidthController.h
3ce878cbc6faa744b0e513ddd12c5eaf62ba16ed 01-May-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 202633d0aa99de903f57c8372cc72b7349ba38e4
18a103d2681920986a5b2192ce9bf6d664f135b1 30-Apr-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 4c2b869a3a30b257acce46d470e92e835a9eb82c
202633d0aa99de903f57c8372cc72b7349ba38e4 30-Apr-2014 Bill Yi <byi@google.com> am 47939704: am 428c861a: (-s ours) Merge klp-dev-plus-aosp into stage-aosp-master

* commit '479397047075e236af9b23848371aa302d95c213':
479397047075e236af9b23848371aa302d95c213 30-Apr-2014 Bill Yi <byi@google.com> am 428c861a: (-s ours) Merge klp-dev-plus-aosp into stage-aosp-master

* commit '428c861a8e8aed4aa3224bd8d18211c9e6ca1c64':
428c861a8e8aed4aa3224bd8d18211c9e6ca1c64 30-Apr-2014 Bill Yi <byi@google.com> Merge klp-dev-plus-aosp into stage-aosp-master

Change-Id: I1c46e9613eb7638531b6abffee43ffc94b116018
0b281c83683b25e2d74e161bf987687ed496fcec 29-Apr-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 4c2b869a3a30b257acce46d470e92e835a9eb82c
97a32f83b1abdcfe371b81bfbbb2a049a9bc4d94 28-Apr-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 4c2b869a3a30b257acce46d470e92e835a9eb82c
b3ec1c9fc5cf35168447dbc34ed0e27715b05128 27-Apr-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 4c2b869a3a30b257acce46d470e92e835a9eb82c
275cf2e8e799097932e150a68973518719594081 26-Apr-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 4c2b869a3a30b257acce46d470e92e835a9eb82c
b062d4d9a749511568e97c2a7e79fd9ae438ec13 24-Apr-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to 4c2b869a3a30b257acce46d470e92e835a9eb82c
b77e5ddf97ae1194881bf97c8efaffb99aa96077 23-Apr-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to master
4c2b869a3a30b257acce46d470e92e835a9eb82c 22-Apr-2014 Robert Greenwalt <rgreenwalt@google.com> am e4f22d3c: am 6aac1ccd: Merge "system: netd: prevent infinite loop"

* commit 'e4f22d3cfc4f8826d27e81f9a87d653ef505b5b7':
system: netd: prevent infinite loop
e4f22d3cfc4f8826d27e81f9a87d653ef505b5b7 22-Apr-2014 Robert Greenwalt <rgreenwalt@google.com> am 6aac1ccd: Merge "system: netd: prevent infinite loop"

* commit '6aac1ccd09d590b014566b4000e7f908cc11e9de':
system: netd: prevent infinite loop
6aac1ccd09d590b014566b4000e7f908cc11e9de 22-Apr-2014 Robert Greenwalt <rgreenwalt@google.com> Merge "system: netd: prevent infinite loop"
3d24dcd5dc06df1c46fb30f4424b94ee18fe8e4b 22-Apr-2014 The Android Automerger <android-build@google.com> merge in master-release history after reset to master
f640f5bf47ee1bcd3d21d954024c823e9f221512 21-Apr-2014 Sasha Levitskiy <sanek@google.com> am 27f0697e: am 2e6b5f77: Merge "Netd: Drop hard-coded libnetcmdiface path, let the system auto-resolve to a proper lib version."

* commit '27f0697e654a7e5126e5633bf825a2178f3872e6':
Netd: Drop hard-coded libnetcmdiface path, let the system auto-resolve to a proper lib version.
27f0697e654a7e5126e5633bf825a2178f3872e6 21-Apr-2014 Sasha Levitskiy <sanek@google.com> am 2e6b5f77: Merge "Netd: Drop hard-coded libnetcmdiface path, let the system auto-resolve to a proper lib version."

* commit '2e6b5f774d26048f0d3e70ae4bfe65f80a5ea1dd':
Netd: Drop hard-coded libnetcmdiface path, let the system auto-resolve to a proper lib version.
2e6b5f774d26048f0d3e70ae4bfe65f80a5ea1dd 21-Apr-2014 Sasha Levitskiy <sanek@google.com> Merge "Netd: Drop hard-coded libnetcmdiface path, let the system auto-resolve to a proper lib version."
a3495b0049152ee641923b64f5285c7b1b605837 21-Apr-2014 Robert Greenwalt <rgreenwalt@google.com> am ae7e21b3: am d76c8c9c: Merge "Fix for DNS resolutions when there is no default network set yet. We need to determine the actual netId to use prior to comparing it against the default netId. Also initialize the default network variable."

* commit 'ae7e21b37f2f196dc2c8b4732b65c6329ec2fae5':
Fix for DNS resolutions when there is no default network set yet. We need to determine the actual netId to use prior to comparing it against the default netId. Also initialize the default network variable.
ae7e21b37f2f196dc2c8b4732b65c6329ec2fae5 21-Apr-2014 Robert Greenwalt <rgreenwalt@google.com> am d76c8c9c: Merge "Fix for DNS resolutions when there is no default network set yet. We need to determine the actual netId to use prior to comparing it against the default netId. Also initialize the default network variable."

* commit 'd76c8c9c66581f310f3d1333405bdcc7fb9c5fb2':
Fix for DNS resolutions when there is no default network set yet. We need to determine the actual netId to use prior to comparing it against the default netId. Also initialize the default network variable.
d76c8c9c66581f310f3d1333405bdcc7fb9c5fb2 21-Apr-2014 Robert Greenwalt <rgreenwalt@google.com> Merge "Fix for DNS resolutions when there is no default network set yet. We need to determine the actual netId to use prior to comparing it against the default netId. Also initialize the default network variable."
17609ed245227ddfbdf96e746fd23532e385f8a4 21-Apr-2014 Sasha Levitskiy <sanek@google.com> Netd: Drop hard-coded libnetcmdiface path, let the system auto-resolve to a proper lib version.

Change-Id: I3604b0610c6aadeaaac7bd970b3d3d190111f0dd
Signed-off-by: Sasha Levitskiy <sanek@google.com>
nterfaceController.cpp
a0d0877f0c305243d8e3e9e9c34d13cae7fe2e60 17-Apr-2014 Paul Jensen <pauljensen@google.com> Fix for DNS resolutions when there is no default network set yet.
We need to determine the actual netId to use prior to comparing
it against the default netId. Also initialize the default network
variable.

bug:13877665
Change-Id: I24c05eb006e2c93d5e0a9b94fee4da408089d2b8
nsProxyListener.cpp
etworkController.cpp
dac2ca3088bc2dfe7ff0afa19e701baeae466f96 17-Apr-2014 Paul Jensen <pauljensen@google.com> Fix for DNS resolutions when there is no default network set yet.
We need to determine the actual netId to use prior to comparing
it against the default netId. Also initialize the default network
variable.

bug:13877665
Change-Id: I24c05eb006e2c93d5e0a9b94fee4da408089d2b8
nsProxyListener.cpp
etworkController.cpp
be1e7d8c0e0abb37262770e2455176413a4b0f7f 17-Apr-2014 Paul Jensen <pauljensen@google.com> Fix for DNS resolutions when there is no default network set yet.
We need to determine the actual netId to use prior to comparing
it against the default netId. Also initialize the default network
variable.

bug:13877665
Change-Id: I24c05eb006e2c93d5e0a9b94fee4da408089d2b8
nsProxyListener.cpp
etworkController.cpp
17de4f01bb665ab5bee735cfa1adaad80fcc6286 04-Apr-2014 Paul Jensen <pauljensen@google.com> Fix build break after a0efaec

Change-Id: Ie8c77a53a3daeef61527ba4544cae417ade16fef
atController.h
7610f99f6cbfd94eafc2f2164ab69f15574c1fa6 04-Apr-2014 Paul Jensen <pauljensen@google.com> resolved conflicts for merge of 5b49ab9e to master

Change-Id: Ib252e3630c5e3b8a38405fc33b147ad365492946
5b49ab9e27f06f5a59013b0d54e530d97cc2ef18 04-Apr-2014 Paul Jensen <pauljensen@google.com> resolved conflicts for merge of 45d7b748 to klp-modular-dev-plus-aosp

Change-Id: I924e2c3c654501034dfa7429c0a54d0462fc1571
45d7b7482e97b7445bf47fba3ffa3af764cadf48 03-Apr-2014 Robert Greenwalt <rgreenwalt@google.com> Merge "netd: Replace iface with opaque netid in resolver."
79c5214e31471e75d79f50b6a282eebe76d2609b 10-Mar-2014 Kenneth Tateno <ktateno@nvidia.com> system: netd: prevent infinite loop

There is a corner case where rescan() runs between
allocateServiceRef and startMonitoring. After
allocateServiceRef is called the node at mHead
has mReady = 0. Then when rescan runs, it loops forver
waiting for mReady != 0, but startMonitoring can't
run because rescan has the lock.

To prevent this, allow rescan to continue to the
next node if mReady == 0.

Change-Id: I7538e00087c02cd6b5553c992bd3c14e1a867a99
DnsSdListener.cpp
a0efaece8c05370f201efe099a537ceb014c6fdf 14-Feb-2014 Szymon Jakubczak <szym@google.com> netd: Replace iface with opaque netid in resolver.

Also ensure that UID mapping (for VPN) cannot be overridden by
android_getaddrinfofornet or per-PID preference.

Change-Id: I9ccfda2902cc0943e87c9bc346ad9a2578accdab
ndroid.mk
ommandListener.cpp
ommandListener.h
nsProxyListener.cpp
nsProxyListener.h
atController.cpp
atController.h
etworkController.cpp
etworkController.h
esolverController.cpp
esolverController.h
econdaryTableController.cpp
econdaryTableController.h
idMarkMap.cpp
idMarkMap.h
ain.cpp
948922bedd835252130cc4d86c2df4878e301a4b 27-Mar-2014 Mark Salyzyn <salyzyn@google.com> am 5faac35c: am 57abed1d: Merge "netd: SCN must be used instead of PRI for scanf functions"

* commit '5faac35cc84bae8c96775a5bc9026012378d6fd4':
netd: SCN must be used instead of PRI for scanf functions
5faac35cc84bae8c96775a5bc9026012378d6fd4 27-Mar-2014 Mark Salyzyn <salyzyn@google.com> am 57abed1d: Merge "netd: SCN must be used instead of PRI for scanf functions"

* commit '57abed1d8463b20a28745894d99942bfa9512e1b':
netd: SCN must be used instead of PRI for scanf functions
57abed1d8463b20a28745894d99942bfa9512e1b 27-Mar-2014 Mark Salyzyn <salyzyn@google.com> Merge "netd: SCN must be used instead of PRI for scanf functions"
ca0b5e275e7405ff4109e83c1cc1c36aabc8167b 26-Mar-2014 Mark Salyzyn <salyzyn@google.com> netd: SCN must be used instead of PRI for scanf functions

Change-Id: I2503fe09e4f90e8339e2b666924f89b33f297af5
andwidthController.cpp
befee96e063a1382c8772ad9fa87bf68f02cf7e1 24-Mar-2014 Chad Brubaker <cbrubaker@google.com> am 294f66f5: am 92ceda97: am f7635e29: Merge "Move VPN routing decisions from iptables to ip" into klp-dev

* commit '294f66f5582b0456f5c2ba20b9170644363b46a7':
Move VPN routing decisions from iptables to ip
ac49dd9163cc357538a721b4ba47580379220182 24-Mar-2014 Chad Brubaker <cbrubaker@google.com> am 41bec8e5: am 803e8d85: am e287d24e: Merge "Allow overlap in UidMarkMap" into klp-dev

* commit '41bec8e5b517c189df908193c4cb6b5b0abdb709':
Allow overlap in UidMarkMap
af2da8e898b914246e0c24fcc354fd42d46d1b99 24-Mar-2014 Chad Brubaker <cbrubaker@google.com> am 4fe6d792: am 6b9ae17f: am 954d5d1b: Merge "Update clearifaceforuidrange to take the interface" into klp-dev

* commit '4fe6d7923802d463a650b1f2b89dd85a008ca868':
Update clearifaceforuidrange to take the interface
77b0b2f36e2387c98ba7246a18c3b2cb161924df 24-Mar-2014 Chad Brubaker <cbrubaker@google.com> am c7c348d7: am 406edcfd: am 2a390120: Mark uids without rules with PROTECT_MARK

* commit 'c7c348d7cad39f06e8e9454f6128a5911d5fdb10':
Mark uids without rules with PROTECT_MARK
294f66f5582b0456f5c2ba20b9170644363b46a7 22-Mar-2014 Chad Brubaker <cbrubaker@google.com> am 92ceda97: am f7635e29: Merge "Move VPN routing decisions from iptables to ip" into klp-dev

* commit '92ceda97cd153f6bee3db04cd0b6d93f32a12551':
Move VPN routing decisions from iptables to ip
92ceda97cd153f6bee3db04cd0b6d93f32a12551 22-Mar-2014 Chad Brubaker <cbrubaker@google.com> am f7635e29: Merge "Move VPN routing decisions from iptables to ip" into klp-dev

* commit 'f7635e290be7bf427736f3849981f12369dd5215':
Move VPN routing decisions from iptables to ip
76f33f0a0864db529cfd47458a0dc331dd1b926f 22-Mar-2014 Chad Brubaker <cbrubaker@google.com> am f7635e29: Merge "Move VPN routing decisions from iptables to ip" into klp-dev

* commit 'f7635e290be7bf427736f3849981f12369dd5215':
Move VPN routing decisions from iptables to ip
f7635e290be7bf427736f3849981f12369dd5215 22-Mar-2014 Chad Brubaker <cbrubaker@google.com> Merge "Move VPN routing decisions from iptables to ip" into klp-dev
620d20109e29e24fcb36753c1940bdc31db97084 22-Mar-2014 Chad Brubaker <cbrubaker@google.com> am e287d24e: Merge "Allow overlap in UidMarkMap" into klp-dev

* commit 'e287d24e9cfd6ed84bdb69a82b6f8357de2fee34':
Allow overlap in UidMarkMap
79c34571869cd1859e803b0ed4c87035ba2e7fe9 22-Mar-2014 Chad Brubaker <cbrubaker@google.com> am 954d5d1b: Merge "Update clearifaceforuidrange to take the interface" into klp-dev

* commit '954d5d1bcdcdfe4522a64ae48827501a6a6d64c0':
Update clearifaceforuidrange to take the interface
41bec8e5b517c189df908193c4cb6b5b0abdb709 21-Mar-2014 Chad Brubaker <cbrubaker@google.com> am 803e8d85: am e287d24e: Merge "Allow overlap in UidMarkMap" into klp-dev

* commit '803e8d85f3b78f06288d4651cd814f3f05fdcebe':
Allow overlap in UidMarkMap
4fe6d7923802d463a650b1f2b89dd85a008ca868 21-Mar-2014 Chad Brubaker <cbrubaker@google.com> am 6b9ae17f: am 954d5d1b: Merge "Update clearifaceforuidrange to take the interface" into klp-dev

* commit '6b9ae17f88919417991147eba90e7c021e062737':
Update clearifaceforuidrange to take the interface
803e8d85f3b78f06288d4651cd814f3f05fdcebe 21-Mar-2014 Chad Brubaker <cbrubaker@google.com> am e287d24e: Merge "Allow overlap in UidMarkMap" into klp-dev

* commit 'e287d24e9cfd6ed84bdb69a82b6f8357de2fee34':
Allow overlap in UidMarkMap
6b9ae17f88919417991147eba90e7c021e062737 21-Mar-2014 Chad Brubaker <cbrubaker@google.com> am 954d5d1b: Merge "Update clearifaceforuidrange to take the interface" into klp-dev

* commit '954d5d1bcdcdfe4522a64ae48827501a6a6d64c0':
Update clearifaceforuidrange to take the interface
e287d24e9cfd6ed84bdb69a82b6f8357de2fee34 21-Mar-2014 Chad Brubaker <cbrubaker@google.com> Merge "Allow overlap in UidMarkMap" into klp-dev
954d5d1bcdcdfe4522a64ae48827501a6a6d64c0 21-Mar-2014 Chad Brubaker <cbrubaker@google.com> Merge "Update clearifaceforuidrange to take the interface" into klp-dev
c7c348d7cad39f06e8e9454f6128a5911d5fdb10 21-Mar-2014 Chad Brubaker <cbrubaker@google.com> am 406edcfd: am 2a390120: Mark uids without rules with PROTECT_MARK

* commit '406edcfde29342be37cbbb326e1b9c4697236cd2':
Mark uids without rules with PROTECT_MARK
00bf68e5270fbf425eb21fc8bd6c4a8268c4d2a7 21-Mar-2014 Chad Brubaker <cbrubaker@google.com> am 2a390120: Mark uids without rules with PROTECT_MARK

* commit '2a390120a9e90ec414d347921039ff98724d0dda':
Mark uids without rules with PROTECT_MARK
406edcfde29342be37cbbb326e1b9c4697236cd2 21-Mar-2014 Chad Brubaker <cbrubaker@google.com> am 2a390120: Mark uids without rules with PROTECT_MARK

* commit '2a390120a9e90ec414d347921039ff98724d0dda':
Mark uids without rules with PROTECT_MARK
3440b6e2ff5712cf12ed5370b226ca2dc2f09574 18-Mar-2014 JP Abgrall <jpa@google.com> am 1f1f159f: am cfb7ebe1: Merge "Fix C++11 violations"

* commit '1f1f159fdfb0512ddca6221a091805a85b4429f1':
Fix C++11 violations
795154a11ea28ef81d93fce3a0f85660f0f0a826 18-Mar-2014 JP Abgrall <jpa@google.com> am cfb7ebe1: Merge "Fix C++11 violations"

* commit 'cfb7ebe1b2dfd31b408f6aa6e3f3fcdf89baa6c4':
Fix C++11 violations
1f1f159fdfb0512ddca6221a091805a85b4429f1 18-Mar-2014 JP Abgrall <jpa@google.com> am cfb7ebe1: Merge "Fix C++11 violations"

* commit 'cfb7ebe1b2dfd31b408f6aa6e3f3fcdf89baa6c4':
Fix C++11 violations
cfb7ebe1b2dfd31b408f6aa6e3f3fcdf89baa6c4 18-Mar-2014 JP Abgrall <jpa@google.com> Merge "Fix C++11 violations"
7776cea21f88c4c01eba509db09bc2ccaa28ed5d 16-Mar-2014 SynergyDev <synergye@codefi.re> Fix C++11 violations

The C++11 standard requires a space between literals and identifiers
andwidthController.cpp
ommandListener.cpp
2ebaf119e2bfd566910020d7ba01c8b12bc5fdf1 25-Feb-2014 Chad Brubaker <cbrubaker@google.com> Allow overlap in UidMarkMap

To support simultaneous tuns UidMarkMap now allows for
overlaping/duplicate rules. If there are multiple rules for a given uid
the most recently added rule will be used in all cases.

When overlapping rules are added in addUidRule there may be multiple
iptables rules matching the uid. Since addUidRule appends it will use
the most recent rule as well, no change required. Previously
UidMarkMap->add would fail and the rule would never be added.

Bug: 12134439
Change-Id: I5f2976dd3ee334584a9f98f6eacd5edbe5c9bb6b
idMarkMap.cpp
1a16c18adff2fd31b8393fb35223cd0bf1e5a509 25-Feb-2014 Chad Brubaker <cbrubaker@google.com> Update clearifaceforuidrange to take the interface

resolv's uid range=>iface map now allows overlap in uid ranges to support
simultaneous tuns. _resolv_clear_iface_for_uid_range now takes the
interface to support removing only one of the rules.

Bug: 12134439
Change-Id: I3e2a167875bbd381846d5c47d7b34c625abfb2e0
ommandListener.cpp
esolverController.cpp
esolverController.h
797ec7038c124b38a7559ab74b169b36ca4705ee 06-Feb-2014 Chad Brubaker <cbrubaker@google.com> Move VPN routing decisions from iptables to ip

Routes are now encoded by ip rules that send connections to the Vpn
table if the connection is marked and the destination falls into a
route. This differs from the previous design where a mark meant that
the connection must go over the VPN, now a mark simply means that it
may.
Bug: 12549060
Change-Id: I9be7e27a0f46858f109d8bc5c5bced309b05201a
ommandListener.cpp
econdaryTableController.cpp
econdaryTableController.h
2a390120a9e90ec414d347921039ff98724d0dda 20-Feb-2014 Chad Brubaker <cbrubaker@google.com> Mark uids without rules with PROTECT_MARK

The default result for a uid without a mark should be MARK_PROTECT
because the service using the uid's mark may be covered by a VPN that
should not cover the user it is acting for.

Bug: 12608570
Change-Id: I2402cb86ddb2fe6e670d1793263ff6c2c31d32fe
nsProxyListener.cpp
etdConstants.h
econdaryTableController.h
idMarkMap.cpp
27ab7e10d7b8343f6354359b3d2c6900d6beed78 12-Mar-2014 Ruchi Kandoi <kandoiruchi@google.com> netd: Add support for timestamp in idletimer netlink notification.

Change-Id: I77e9052e988d65c6b543441a8f03876bcd7c15ce
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
etlinkHandler.cpp
etlinkHandler.h
113ccda10b10231b4d1f77fccdaff43f4bcff865 11-Mar-2014 Calin Juravle <calin@google.com> am 491086e5: Merge "Changed path to the private dns headers Bug: 13219633"

* commit '491086e5f523b5ae86734e135dd8685499c954fa':
Changed path to the private dns headers Bug: 13219633
9ea6f522386c8d3751aa6fe6894eae23fc811bab 04-Mar-2014 Calin Juravle <calin@google.com> am a86f2b6c: am 491086e5: Merge "Changed path to the private dns headers Bug: 13219633"

* commit 'a86f2b6c761954b978b3c8346d1040efca8d1ec6':
Changed path to the private dns headers Bug: 13219633
a86f2b6c761954b978b3c8346d1040efca8d1ec6 04-Mar-2014 Calin Juravle <calin@google.com> am 491086e5: Merge "Changed path to the private dns headers Bug: 13219633"

* commit '491086e5f523b5ae86734e135dd8685499c954fa':
Changed path to the private dns headers Bug: 13219633
491086e5f523b5ae86734e135dd8685499c954fa 04-Mar-2014 Calin Juravle <calin@google.com> Merge "Changed path to the private dns headers Bug: 13219633"
3c3993b4340abf63974c46049b3bd86ce82237ef 04-Mar-2014 Calin Juravle <calin@google.com> Changed path to the private dns headers
Bug: 13219633

Change-Id: Ia7f3da59925621b449bacfeb220ab8f8e3be8d88
ndroid.mk
ef7ca5219fc43dcf2a1a39fa70ce3eb6e9b42608 04-Mar-2014 Christopher Lane <lanechr@google.com> am c0bc14a3: Add support for custom TXT records

* commit 'c0bc14a3c2f0efe1f368f2120de38e99ccb6d9f0':
Add support for custom TXT records
c0bc14a3c2f0efe1f368f2120de38e99ccb6d9f0 26-Feb-2014 Christopher Lane <lanechr@google.com> Add support for custom TXT records

This isn't supported higher up in the stack yet, so use command line to test.
E.g. "ndc mdns mdnssd register 4 Kitten _kitten._tcp 4242 sound=meow color=pink"

Change-Id: I261c17465ae677f91a289077b6e363a149c94c3e
DnsSdListener.cpp
c79bcc491f01b4d7956d7bd01f0e912e22307f41 12-Feb-2014 Ashish Sharma <ashishsharma@google.com> NetlinkHandler: Revert the special handling of event param name.

The kernel change was reverted to remain consistent with past API.

Change-Id: I60a539aaf3bd78a56ab54391685f6aaf07de19ce
etlinkHandler.cpp
1c2c27f0482f14d08fdc9a27972c7d73499c4622 04-Feb-2014 Ashish Sharma <ashishsharma@google.com> Initialize IDLETIMER iptables rules for ipv6.

Bug: 12845905
Change-Id: I28f460766a29f0ca4386c8064ffe52c39f907084
dletimerController.cpp
62b5751781523a7535d72d14a1bf420fa869be8c 24-Jan-2014 Colin Cross <ccross@android.com> am 19d49454: am 2bd389e3: Merge "AArch64: Fix printf format strings."

* commit '19d494543311f5a51983f82d2a1605461e2a4beb':
AArch64: Fix printf format strings.
19d494543311f5a51983f82d2a1605461e2a4beb 24-Jan-2014 Colin Cross <ccross@android.com> am 2bd389e3: Merge "AArch64: Fix printf format strings."

* commit '2bd389e386feeef0a901ccf68b106eafea6bbcb4':
AArch64: Fix printf format strings.
2bd389e386feeef0a901ccf68b106eafea6bbcb4 24-Jan-2014 Colin Cross <ccross@android.com> Merge "AArch64: Fix printf format strings."
2a54d96c5ae809216965e6f86e70cdae2ed7e09c 14-Jan-2013 Matthew Leach <matthew.leach@arm.com> AArch64: Fix printf format strings.

Use the portable printf format strings as defined in:

http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#64-bit_Portability

These changes are necessary when compiling for LP64 architectures.

Change-Id: I3ff355dda5a7a72a8e659a7e5d2014aa4e62f8c3
Signed-off-by: Matthew Leach <matthew.leach@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
andwidthController.cpp
ommandListener.cpp
nsProxyListener.cpp
36b34c943ba76fa4989c1460a4d2a837457b4807 24-Jan-2014 Colin Cross <ccross@android.com> am f8b19aa2: am 05952ccb: Merge "netd: remove from include path"

* commit 'f8b19aa2b6b182261f74ce4265247a2d7a64801b':
netd: remove $(KERNEL_HEADERS) from include path
f8b19aa2b6b182261f74ce4265247a2d7a64801b 24-Jan-2014 Colin Cross <ccross@android.com> am 05952ccb: Merge "netd: remove from include path"

* commit '05952ccb4a2f44ada2eb0d11480eb2780c8caa91':
netd: remove $(KERNEL_HEADERS) from include path
05952ccb4a2f44ada2eb0d11480eb2780c8caa91 24-Jan-2014 Colin Cross <ccross@android.com> Merge "netd: remove $(KERNEL_HEADERS) from include path"
e55ec1b60b76172891572208fcfa7d96b131ac05 23-Jan-2014 Colin Cross <ccross@android.com> netd: remove $(KERNEL_HEADERS) from include path

The kernel headers are already in the include path, and manually
adding them again will break on a multiarch build, where the
kernel headers may be different for each arch.

Change-Id: I0f07ecde4c519341153e58e3cdd6441e84362ae1
ndroid.mk
aedb0a7c524d018e215446c4fca8885710089b1a 18-Dec-2013 Dmitry Shmidt <dimitrysh@google.com> resolved conflicts for merge of 124d77eb to master

Change-Id: Ic28a38b2d6acf2b4fb3e0da3794fea6fd37d9981
124d77eb1fadb9364f8caf1baffbaefce5781026 18-Dec-2013 Dmitry Shmidt <dimitrysh@google.com> am 7f4117ee: Merge "tethering: Add --dhcp-authoritative to dnsmasq daemon"

* commit '7f4117ee430e5069bffc89ad4e3841845586951a':
tethering: Add --dhcp-authoritative to dnsmasq daemon
7f4117ee430e5069bffc89ad4e3841845586951a 18-Dec-2013 Dmitry Shmidt <dimitrysh@google.com> Merge "tethering: Add --dhcp-authoritative to dnsmasq daemon"
bc775ed3aca7f14fb5e2b66dfdcb5da87ce9b4d5 13-Dec-2013 Dmitry Shmidt <dimitrysh@google.com> tethering: Add --dhcp-authoritative to dnsmasq daemon

Bug: 12114185

Change-Id: I91e83c78de251ebe88bed30174f1422b62edca07
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
etherController.cpp
f3a31ce2eaa5fdf280946d3bd8729007d8f27ed7 13-Dec-2013 Dmitry Shmidt <dimitrysh@google.com> tethering: Add --dhcp-authoritative to dnsmasq daemon

Bug: 12114185

Change-Id: I91e83c78de251ebe88bed30174f1422b62edca07
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
etherController.cpp
6f502dd1c59b3c991466ef0b251eedcb95da2b93 10-Dec-2013 Sreeram Ramachandran <sreeram@google.com> Fix duplicate rule count modification.

ag/161626 introduced modifyRuleCount() to centralize rule count mutations, but
didn't remove the redundant block above the callsite in modifyRoute().

Change-Id: I5164ccf0d92041836166dcb5798be168276d3e7d
econdaryTableController.cpp
0cf02a2dd4a66938c651e42d09f236eb52b245ba 09-Dec-2013 Sreeram Ramachandran <sreeram@google.com> Fix typo in removeFwmarkRoute().

The typo was in the original CL that introduced this code (ag/326064).

Change-Id: Ib424189194f338b195026026c3d767ab0da53175
econdaryTableController.cpp
3be312caf92a960b447295e22274e0b8f20c0426 23-Nov-2013 The Android Open Source Project <initial-contribution@android.com> am bf442063: am 57c2b4c8: Merge commit \'f0aa90f7898502aae6a015b49abcb2a5a0719fad\' into HEAD

* commit 'bf4420633fd1a84a7dcabeebe768d7a14ed76c7e':
bf4420633fd1a84a7dcabeebe768d7a14ed76c7e 23-Nov-2013 The Android Open Source Project <initial-contribution@android.com> am 57c2b4c8: Merge commit \'f0aa90f7898502aae6a015b49abcb2a5a0719fad\' into HEAD

* commit '57c2b4c8aa5d66cb3198770d1a71f299b8b14470':
611f221cbb87cb1876f17244c1edb62ca6f38fa6 22-Nov-2013 Dmitry Shmidt <dimitrysh@google.com> Merge "softap: Try wpa/wpa2 as best effort"
57c2b4c8aa5d66cb3198770d1a71f299b8b14470 22-Nov-2013 The Android Open Source Project <initial-contribution@android.com> Merge commit 'f0aa90f7898502aae6a015b49abcb2a5a0719fad' into HEAD

Change-Id: If9a70bdfa24a37bab6980194af6fa4f73d9f4bd1
45dff308158ba43e427b2dc1128f6d18474d3039 22-Nov-2013 Dmitry Shmidt <dimitrysh@google.com> softap: Try wpa/wpa2 as best effort

Change-Id: I02ff0b01e96ac7bb3044df9621ebf7c8a62cb6c2
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
fa975b1a2054d7e98a1e62da2153321970481611 22-Nov-2013 Lorenzo Colitti <lorenzo@google.com> am 3ccff3ba: am 22f485dc: Merge "Make netd listen for and notify RDNSS options."

* commit '3ccff3ba816338b85dd87555a7803cb8e803f4e5':
Make netd listen for and notify RDNSS options.
39b7879db5140fa5c33601cb4775a0f6f4e5c787 22-Nov-2013 Lorenzo Colitti <lorenzo@google.com> am 70cf5074: (-s ours) am 6eeea7cb: Merge "Simplify notification code in NetlinkHandler."

* commit '70cf50742decc490b93c1d15a49db00125c73d64':
Simplify notification code in NetlinkHandler.
3f30289fbb2b1d4d31dc3e16033569644261643c 22-Nov-2013 Lorenzo Colitti <lorenzo@google.com> am 3995bf50: am 634b7b7b: Merge "Don\'t log "Unexpected netlink message" on NDUSEROPT"

* commit '3995bf502e1298109baba41a7dbc0a272530d9a8':
Don't log "Unexpected netlink message" on NDUSEROPT
35d599c01b7bda82b6c5e2d04d98b9976d823303 22-Nov-2013 Lorenzo Colitti <lorenzo@google.com> am 6931528a: am 1dc26be0: Merge "Unbreak interface add/delete notifications."

* commit '6931528a7914737dc5b7f530a4b5db6f1147fe57':
Unbreak interface add/delete notifications.
ce987e4adf121e31ddc0f5bdcf49f2925e6687f6 22-Nov-2013 Lorenzo Colitti <lorenzo@google.com> am 307650e1: am 4006ada5: (-s ours) Merge "Make netd track and notify IP address changes."

* commit '307650e17a12452c1ce5ddab02e6027baf6a10cb':
Make netd track and notify IP address changes.
3ccff3ba816338b85dd87555a7803cb8e803f4e5 22-Nov-2013 Lorenzo Colitti <lorenzo@google.com> am 22f485dc: Merge "Make netd listen for and notify RDNSS options."

* commit '22f485dc390ba75c76645d2ced812cd1988b6bf0':
Make netd listen for and notify RDNSS options.
70cf50742decc490b93c1d15a49db00125c73d64 22-Nov-2013 Lorenzo Colitti <lorenzo@google.com> am 6eeea7cb: Merge "Simplify notification code in NetlinkHandler."

* commit '6eeea7cb5a563cf8369c8373ae469ef1f676d7a9':
Simplify notification code in NetlinkHandler.
3995bf502e1298109baba41a7dbc0a272530d9a8 22-Nov-2013 Lorenzo Colitti <lorenzo@google.com> am 634b7b7b: Merge "Don\'t log "Unexpected netlink message" on NDUSEROPT"

* commit '634b7b7b6c83269e5c1ad71b871f8c5a7a020c0d':
Don't log "Unexpected netlink message" on NDUSEROPT
6931528a7914737dc5b7f530a4b5db6f1147fe57 22-Nov-2013 Lorenzo Colitti <lorenzo@google.com> am 1dc26be0: Merge "Unbreak interface add/delete notifications."

* commit '1dc26be03b0ace9a52a23caaa669a4edf9b0bd85':
Unbreak interface add/delete notifications.
307650e17a12452c1ce5ddab02e6027baf6a10cb 22-Nov-2013 Lorenzo Colitti <lorenzo@google.com> am 4006ada5: (-s ours) Merge "Make netd track and notify IP address changes."

* commit '4006ada573f332b5ef4d32273bd4e2c058aa2b73':
Make netd track and notify IP address changes.
cb0873952daadd73aed3bb9219fa3482f7a4d360 21-Nov-2013 JP Abgrall <jpa@google.com> am 9440e7f9: SecondaryTableController: force the MSS to match pmtu on TCP SYN

* commit '9440e7f994901ca123393844c95fe5caa6639a3b':
SecondaryTableController: force the MSS to match pmtu on TCP SYN
9440e7f994901ca123393844c95fe5caa6639a3b 21-Nov-2013 JP Abgrall <jpa@google.com> SecondaryTableController: force the MSS to match pmtu on TCP SYN

Without this change, the VPN sets up a tun/ppp that needs a small
MTU, and during TCP SYN the MSS will end up matching the outgoing iface
MTU which is potentially too big.
This leads to connection flakiness. The wrong MSS is visible by
tcpdump-ing on the tun/ppp device.

With this change, the MSS now is correct.
It requires the kernel to be configured with
CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
If kernel is not configured, it silently fails.

Bug: 11579326
Change-Id: I254d8c39435b92dff91931e461e1efb8b35f6b1e
ommandListener.cpp
econdaryTableController.cpp
econdaryTableController.h
22f485dc390ba75c76645d2ced812cd1988b6bf0 20-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Merge "Make netd listen for and notify RDNSS options."
6eeea7cb5a563cf8369c8373ae469ef1f676d7a9 20-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Merge "Simplify notification code in NetlinkHandler."
634b7b7b6c83269e5c1ad71b871f8c5a7a020c0d 20-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Merge "Don't log "Unexpected netlink message" on NDUSEROPT"
1dc26be03b0ace9a52a23caaa669a4edf9b0bd85 20-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Merge "Unbreak interface add/delete notifications."
4006ada573f332b5ef4d32273bd4e2c058aa2b73 20-Nov-2013 Lorenzo Colitti <lorenzo@google.com> Merge "Make netd track and notify IP address changes."
0a227c2bc4d1159834ac51c2e08b4917bf596d83 24-Oct-2013 Lorenzo Colitti <lorenzo@google.com> Make netd listen for and notify RDNSS options.

[Cherry-pick of 12acae8db9dee865a41f0fd11dacf01112115920]

Bug: 9180552
Change-Id: Id2485b35c2299cfc455dd2b3b725136e5eb2a7e4
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.cpp
esponseCode.h
529c28e80203affab5bdf43d9d2ce60440a3bb5d 25-Oct-2013 Lorenzo Colitti <lorenzo@google.com> Simplify notification code in NetlinkHandler.

1. Factor most of the notification code out to a common function.
2. Use vasprintf instead of snprintf so we don't have to worry
about clipping notifications due to fixed-size message
buffers.

[Cherry-pick of 0b454ea4abdc8a563af6da58fa37835729220acf]

Bug: 9180552
Change-Id: Idde16ee6dd56d38dab866f0ea678b04d98b3048d
etlinkHandler.cpp
etlinkHandler.h
f4e55095146e0b9e8fc0da7c5e0bd6212c486899 12-Sep-2013 Lorenzo Colitti <lorenzo@google.com> Don't log "Unexpected netlink message" on NDUSEROPT

When opening the netlink socket, NetlinkManager specifies it's
interested in ND_USEROPT messages, but we since we don't have
code to parse them yet, we end up logging an error message for
packets that contain them. Get rid of the logspam by not asking
the kernel to receive them.

[Cherry-pick of a95f8a3426e6a4f17cf41888673f58302781b7be]

Bug: 10718651
Change-Id: Ib1b7748448a983cfa7bb7725e48e238d85152ea2
etlinkManager.cpp
38d72a2b3b91e5bfdbe3013a0adefc356f6dae1b 02-Sep-2013 Lorenzo Colitti <lorenzo@google.com> Unbreak interface add/delete notifications.

The change to enable address tracking via netlink incorrectly
changed the subsystem of rtnetlink events from "net" to
"interface". This broke interface add/delete notifications,
which come from the kernel with subsystem "net".

Switch back to "net" and deal with address tracking via new
action codes instead of a new subsystem.

[Cherry-pick of 4da12db25b4a2947b1a98b0322e4be56a30c5e17]

Bug: 10433320
Change-Id: I59a50e9c7cb49f46e680c7d84ac8e196a861ca4b
etlinkHandler.cpp
80a25984d6721e8916c674fb54f8aea66f2a2ace 01-Aug-2013 Lorenzo Colitti <lorenzo@google.com> Make netd track and notify IP address changes.

Subscribe netd's netlink socket to listen to IPv4 and IPv6
address changes (and ND opts, which we'll need for IPv6 DNS
later), and make NetlinkHandler notify the system of address
changes.

[Cherry-pick of 9b3cd7635caf5948d7d4b11f8f588c9d2811d58e]

Bug: 10232006
Change-Id: Ib9dfd58635dce389980d8ee9529a17661a02320a
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.cpp
esponseCode.h
12acae8db9dee865a41f0fd11dacf01112115920 24-Oct-2013 Lorenzo Colitti <lorenzo@google.com> Make netd listen for and notify RDNSS options.

Bug: 9180552
Change-Id: Id2485b35c2299cfc455dd2b3b725136e5eb2a7e4
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.cpp
esponseCode.h
0b454ea4abdc8a563af6da58fa37835729220acf 25-Oct-2013 Lorenzo Colitti <lorenzo@google.com> Simplify notification code in NetlinkHandler.

1. Factor most of the notification code out to a common function.
2. Use vasprintf instead of snprintf so we don't have to worry
about clipping notifications due to fixed-size message
buffers.

Bug: 9180552
Change-Id: Idde16ee6dd56d38dab866f0ea678b04d98b3048d
etlinkHandler.cpp
etlinkHandler.h
cf7c488008839b7c0341628c869bddf26b9daa99 09-Oct-2013 Ed Heyl <edheyl@google.com> am f0aa90f7: merge in KFS78N (no-op)

* commit 'f0aa90f7898502aae6a015b49abcb2a5a0719fad':
f0aa90f7898502aae6a015b49abcb2a5a0719fad 09-Oct-2013 Ed Heyl <edheyl@google.com> merge in KFS78N (no-op)
670f157d31a4089fd37b591bb7845f664e3c368d 04-Oct-2013 Robert Greenwalt <rgreenwalt@google.com> am 2dae2f87: Don\'t vpn dns if the vpn didn\'t provide servers

* commit '2dae2f8729c3254d5f805ce3df535458db193c12':
Don't vpn dns if the vpn didn't provide servers
2dae2f8729c3254d5f805ce3df535458db193c12 25-Sep-2013 Robert Greenwalt <rgreenwalt@google.com> Don't vpn dns if the vpn didn't provide servers

A split-tunnel vpn shouldn't snarf all dns queries if it's not
going to provide dns servers to service them.

bug:10115444
Change-Id: I4f8de66b75a04ca0e274edb92ace7acee762bca2
nsProxyListener.cpp
d465b1df08e16ad4d6e054d4fe309b5b147d4666 16-Sep-2013 The Android Automerger <android-build@google.com> merge in klp-factoryrom-release history after reset to klp-release
f3cc83fa5b14455589af83b20998885452cdc46d 12-Sep-2013 JP Abgrall <jpa@google.com> NatController: Fix tethering-counting iptables rules handling

Fix duplicate tethering-pair detection. It was broken because the
underlying mechanism used quota2 which has a 15char limit and
the two combined interface names were longer than that.

Fix parsing or tether-counting rules when no interfaces are available
vs when parsing is broken.
Now the parser is not invoked if no tether-counting rules were created.

Bug: 10710027
Change-Id: I37899d113a37cd84255d439efa6e2ed3ce712ec0
andwidthController.cpp
andwidthController.h
ommandListener.cpp
atController.cpp
atController.h
a95f8a3426e6a4f17cf41888673f58302781b7be 12-Sep-2013 Lorenzo Colitti <lorenzo@google.com> Don't log "Unexpected netlink message" on NDUSEROPT

When opening the netlink socket, NetlinkManager specifies it's
interested in ND_USEROPT messages, but we since we don't have
code to parse them yet, we end up logging an error message for
packets that contain them. Get rid of the logspam by not asking
the kernel to receive them.

Bug: 10718651
Change-Id: Ib1b7748448a983cfa7bb7725e48e238d85152ea2
etlinkManager.cpp
991693e023ddbf9f9da25e1fbb06c0fef71915a9 11-Sep-2013 Jeff Sharkey <jsharkey@android.com> Missing tethering stats isn't an error.

When a device first boots, there won't be any tethering stats, which
isn't an error. Continue checking for partial results.

Bug: 5868832
Change-Id: Ic432f5f159320da9886d85c2525fa2cde8c67750
andwidthController.cpp
4da12db25b4a2947b1a98b0322e4be56a30c5e17 02-Sep-2013 Lorenzo Colitti <lorenzo@google.com> Unbreak interface add/delete notifications.

The change to enable address tracking via netlink incorrectly
changed the subsystem of rtnetlink events from "net" to
"interface". This broke interface add/delete notifications,
which come from the kernel with subsystem "net".

Switch back to "net" and deal with address tracking via new
action codes instead of a new subsystem.

Bug: 10433320
Change-Id: I59a50e9c7cb49f46e680c7d84ac8e196a861ca4b
etlinkHandler.cpp
0e540ec038dfdbcf5cba3d5b9b2765e1dcec062b 27-Aug-2013 JP Abgrall <jpa@google.com> BandwidthController: fix bad flushing for bw_costly_* tables.

Some of the bw_costly_<iface> rules would not get correctly flushed and
cleared on netd re-start, which would cause a failure when trying to
setup the bw_penalty_box as bw_costly_<iface> would reference it.
The resulting symptom would be that bandwidth could not be re-enabled.

Bug: 10183445
Change-Id: I79a8a73ae52e18b3bff8a58e47ac1aea2454ae63
andwidthController.cpp
andwidthController.h
9b3cd7635caf5948d7d4b11f8f588c9d2811d58e 01-Aug-2013 Lorenzo Colitti <lorenzo@google.com> Make netd track and notify IP address changes.

Subscribe netd's netlink socket to listen to IPv4 and IPv6
address changes (and ND opts, which we'll need for IPv6 DNS
later), and make NetlinkHandler notify the system of address
changes.

Bug: 10232006
Change-Id: Ib9dfd58635dce389980d8ee9529a17661a02320a
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.cpp
esponseCode.h
979f54172af12d04fbcf07703b1db1891fa39d4c 01-Aug-2013 Robert Greenwalt <rgreenwalt@google.com> am bca84afd: Merge "Incorrect memset parameters"

* commit 'bca84afd429667bf25f2288f254f6e854bcb0f04':
Incorrect memset parameters
bca84afd429667bf25f2288f254f6e854bcb0f04 01-Aug-2013 Robert Greenwalt <rgreenwalt@google.com> Merge "Incorrect memset parameters"
a3ebcb8c2ceef6b92a672a24529cbd098f487965 19-Jul-2013 Edward Savage-Jones <edward.savage-jones@sonymobile.com> Incorrect memset parameters

Memset parameters swapped

Change-Id: I528c1f6de344447d3c43d89c1dd4cd87e1c5c5a7
DnsSdListener.cpp
27c94ee2fe2e7d704dc04f47796e1b1a8531b3b2 23-Jul-2013 Geremy Condra <gcondra@google.com> Merge "Host exemption now handles premarked sockets"
2349aa60771baae85b1f5fc96e653ac2ef95034b 16-Jul-2013 Chad Brubaker <cbrubaker@google.com> Host exemption now handles premarked sockets

Host exemption now properly handles routing for sockets that were
already marked

Change-Id: I55d5c00754036a5ef49379170c37607d3e71a1e8
econdaryTableController.cpp
econdaryTableController.h
e10cdcd4615d679bd8a9a6b07985e484175f3856 18-Jul-2013 Robert Greenwalt <rgreenwalt@google.com> am 8ab6df2e: am 08ff0e40: Merge "Fix memset call"

* commit '8ab6df2e2a4df8eb2c6bcd3325c8ac7a5b01c63e':
Fix memset call
8ab6df2e2a4df8eb2c6bcd3325c8ac7a5b01c63e 18-Jul-2013 Robert Greenwalt <rgreenwalt@google.com> am 08ff0e40: Merge "Fix memset call"

* commit '08ff0e408976d541dae0fc36527c15195cc86cda':
Fix memset call
08ff0e408976d541dae0fc36527c15195cc86cda 18-Jul-2013 Robert Greenwalt <rgreenwalt@google.com> Merge "Fix memset call"
1c4a77955acdb730d017b15e9a92ca511e6ca106 18-Jul-2013 Wang Liyong <liyong.x.wang@sonymobile.com> Fix memset call

Parameters was passed in the wrong order.

Change-Id: I1d4d68f1ba729bf54da84cbcb5f631938ac697f2
ommandListener.cpp
73a0ed547692599edfdc49d20e7903af4c1b80b2 13-Jul-2013 Geremy Condra <gcondra@google.com> Merge "Add netd commands to get marks for routing"
01925a682c68c0083441001d544b00cdcdd1498a 12-Jul-2013 Geremy Condra <gcondra@google.com> Merge "Add destination host exemption to VPN routing"
9d433316d408cd93b0c18dc0caf8e72dfc6179f0 12-Jul-2013 Geremy Condra <gcondra@google.com> Merge "Add support for fwmark split tunneling"
da7df7c8f009f014486343cfbbaaae2a766f3a2b 11-Jul-2013 Chad Brubaker <cbrubaker@google.com> Add netd commands to get marks for routing

Add commands for fetching the mark associated with routing a uid and for
fetching the mark associated with avoiding the fwmark routing rules

Change-Id: I4accd1a9aecd91f6f0630eb1a5466a81e309eeac
ommandListener.cpp
esponseCode.h
econdaryTableController.cpp
econdaryTableController.h
9ba91b9045b2d760789c6854e574494686e0b64c 12-Jul-2013 Geremy Condra <gcondra@google.com> Merge "Add netd support for uid based routing for DNS"
4a946095dad15548ae399665be111be9cb1d9aa6 10-Jul-2013 Chad Brubaker <cbrubaker@google.com> Add destination host exemption to VPN routing

requestRouteToHost requires the ability to punch holes in the VPN for
certain addresses, this adds support for this under mark based VPNs.

Change-Id: I9d890829048624d43c0f1efaec54563a860e850f
ommandListener.cpp
econdaryTableController.cpp
econdaryTableController.h
2251c0fbcf24a9c8fd77b23851f60304087bab2b 28-Jun-2013 Chad Brubaker <cbrubaker@google.com> Add support for fwmark split tunneling

Packets are now only marked for fwmark if their destination is in one of
the routes for the target interface.

Change-Id: Ided4ad992c4cf957d77ae11fa62ac4843a8592c7
ommandListener.cpp
econdaryTableController.cpp
econdaryTableController.h
idMarkMap.cpp
idMarkMap.h
7e51cde19af016456fff750f745db8132f3124a5 03-Jul-2013 JP Abgrall <jpa@google.com> BandwidthController: prefix chains with bw_

Just a cleanup.

Change-Id: Ic5afd7bd194fdcad604d533ba95e4c23b10b3e24
andwidthController.cpp
af476f7b659beff8315a83f094ce697c5179dae6 03-Jul-2013 JP Abgrall <jpa@google.com> BandwidthController: allow UID 0 as a "special uid"

The happy box needs to be able to let UID 0 (dhcp, ...) pass through.

Bug: 6212480
Change-Id: I9867b7db4e5ad71cfb1170659d2d6a14ca9590be
andwidthController.cpp
e478873947f995e44e8c559342462c177a420ae0 03-Jul-2013 JP Abgrall <jpa@google.com> BandwidthController: add support for "nice apps" and the "happy box"

* ndc bandwidth happybox (enable | disable)
- enable
. creates a an empty happy_box chain which rejects all traffic from all UIDs by default.
. Uses the penalty_box as a hook. Any costly_interface automatically gets the happy_box as it has a penalty_box.
. any app UID not in the happy_box will be treated as if it was in the penalty_box (i.e. addnaughtyapps)
. penalty_box (addnaughtyapps) still applies.
- disable
. removes the happy box.
* ndc bandwidth addniceapps <appUid> ...
- similar to addnaughtyapps, but for the happy_box
* ndc bandwidth removeniceapps <appUid> ...
- similar to removenaughtyapps, but for the happy_box

Bug: 6212480
Change-Id: I1f10e8c6fa1b230c7b3bb070d88508e437589705
andwidthController.cpp
andwidthController.h
ommandListener.cpp
a9ba4cba3369e07aae05607f82424cc0075c9c34 03-Jul-2013 JP Abgrall <jpa@google.com> BandwidthController: switch to generic handling for naughty apps.

Rename some stuff in preparation for nice apps and the "happy box".

Bug: 6212480
Change-Id: I637c4283695ac619533999beab4f88968580d2e4
andwidthController.cpp
andwidthController.h
340d5ccf04d4d441d8dd1788a7925d0313038b7c 29-Jun-2013 JP Abgrall <jpa@google.com> BandwidthController: reject with port-unreachable to prevent TCP retries.

Currently the bandwidth controller will cut off traffic via an ICMP
destination unreachable message with code "administratively prohibited".
TCP's RFC1122 does not explicitly say what to do with it, but it does say
to abort the transmission when "port-unreachable" is seen.

Some servers keep on retrying with the "prohibited" ICMP message which
keeps the radio longer awake as more packets come in.

Bug: 9150002
Change-Id: I6eb1c3ae41c3890f26581a4b7464821b7ffb85f4
andwidthController.cpp
d2617936acc15567fc5111bbdb4dde20845c3cba 22-Jun-2013 Chad Brubaker <cbrubaker@google.com> Add netd support for uid based routing for DNS

DNSProxyListener now supports bionic changes for marking DNS requests
for routing DNS requests with the uid routing rules

Change-Id: Iac9aa1bb14834be6da5e512405f23c6a72dc71ed
ndroid.mk
ommandListener.cpp
ommandListener.h
nsProxyListener.cpp
nsProxyListener.h
econdaryTableController.cpp
econdaryTableController.h
idMarkMap.cpp
idMarkMap.h
ain.cpp
baeccc455b293c2c83dbe6463f56b741177bd612 25-Jun-2013 JP Abgrall <jpa@google.com> netd: tethering stats: persistent + list-all support

* Persistent stats
Previously we would parse the iptables counters out of the FORWARD
rules used for tethering. Those rules could come an go before they
were parsed, which would cause us to incorrectly count traffic.
Now we have separate counting rules (and quota2 counters) which
persist beyond tethering.

* Rename the iface0/iface1
Match NatControllers notions for tethering ifaces during enable.
Detect weird call from userspace (until b/9565268 gets fixed),
or else it leaves an ugly iptables state.

* The commands affected:
- ndc bandwidth gettetheringstats intIface extIface
. no change from before: return a single stats line
- ndc bandwidth gettetheringstats
. return a list of results showing all tethered stats
- ndc bandwidth gettetheringstats "" extIface
- ndc bandwidth gettetheringstats intIface
. return a list of results matching the tethering on
the given interface.

Bug: 9565268
Bug: 5868832
Change-Id: I8559d9a184abcffaf65998fb3cc8c9c50d46bf06
andwidthController.cpp
andwidthController.h
ommandListener.cpp
atController.cpp
atController.h
esponseCode.h
eb648acc30c3b04823c8ee533b12ae56d772ce47 21-Jun-2013 Nick Kralevich <nnk@google.com> am 5ff04590: am 4ea5bd05: Merge "Revert "netd: reduce privileges""

* commit '5ff04590386a08712d83c4f8add6d78870fe3bce':
Revert "netd: reduce privileges"
5ff04590386a08712d83c4f8add6d78870fe3bce 21-Jun-2013 Nick Kralevich <nnk@google.com> am 4ea5bd05: Merge "Revert "netd: reduce privileges""

* commit '4ea5bd0540bf3b4b6767815b5c9e41a7146f749c':
Revert "netd: reduce privileges"
4ea5bd0540bf3b4b6767815b5c9e41a7146f749c 21-Jun-2013 Nick Kralevich <nnk@google.com> Merge "Revert "netd: reduce privileges""
59d2d45f8a4405dd5981488f122f34ff4c0030aa 20-Jun-2013 Nick Kralevich <nnk@google.com> Revert "netd: reduce privileges"

jpa reports that tethering is broken.

This reverts commit ab3df62f7b5584af6dee4f5ec069b70dd4f4cee6.

Change-Id: I0736f0fd83ea7cada9fdaee7e8d39123d2a3b5c2
ain.cpp
7b3ab3345b60a36dac0198591ccf21823feb4449 20-Jun-2013 Nick Kralevich <nnk@google.com> am 4dbd276e: am 30583ec3: Merge "netd: reduce privileges"

* commit '4dbd276e59f4d04028effd8510bb3a1e5cb31823':
netd: reduce privileges
4dbd276e59f4d04028effd8510bb3a1e5cb31823 20-Jun-2013 Nick Kralevich <nnk@google.com> am 30583ec3: Merge "netd: reduce privileges"

* commit '30583ec326fb85f5f2638a6582d6f573fd57b42c':
netd: reduce privileges
30583ec326fb85f5f2638a6582d6f573fd57b42c 20-Jun-2013 Nick Kralevich <nnk@google.com> Merge "netd: reduce privileges"
be746818fc7964e5d52d17d07fe173b40a474465 20-Jun-2013 JP Abgrall <jpa@google.com> ndc: re-instate the command sequence num

Some prior change removed the ability to use a command sequence number.
This would cause conflicts with java-land sending commands, and results
don't get routed appropriatly: ndc would catch results destined for java.
Also, cleanup the bad errno handling: don't use errno after any library
call.

Bug: 5886205
Change-Id: I72cafb7d8f8328a6879971e6dd5401f8c20a21f9
dc.c
ab3df62f7b5584af6dee4f5ec069b70dd4f4cee6 20-Jun-2013 Nick Kralevich <nnk@google.com> netd: reduce privileges

netd doesn't need full root capabilities. Rather, it only needs
CAP_NET_ADMIN and CAP_NET_RAW. Reduce the capabilities to that
set.

netd continues to run with UID=0, which allows applications spawned
by netd to continue to have CAP_NET_ADMIN and CAP_NET_RAW. It also
allows netd to access /proc and /sys files as UID=0.

Change-Id: I439d22150109697213c0cc83276ddb668007b978
ain.cpp
6288e21799c92039cf1058a76caa07a960d4a708 12-Jun-2013 Geremy Condra <gcondra@google.com> Merge "Make uid marking rule's API consistent"
8830b94cf4824e5a6c738d39d3015c8eec976352 12-Jun-2013 Chad Brubaker <cbrubaker@google.com> Make uid marking rule's API consistent

Make the netd binds for adding uid iptables mark rules consistent with
the other per uid range binds.

Change-Id: I97d1576f4ac11368bf6ede866229e456a2ed24da
ommandListener.cpp
econdaryTableController.cpp
econdaryTableController.h
6d6c0e6f1164e3182538cb48c2b95d90a2eb780c 12-Jun-2013 Dmitry Shmidt <dimitrysh@google.com> Add getmtu and setmtu interface commands

Bug: 9372485

Change-Id: I0dfa6b1f973426d67f976a9c79be8de90e3d9c19
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ommandListener.cpp
nterfaceController.cpp
nterfaceController.h
etdConstants.cpp
etdConstants.h
esponseCode.h
1b0a79e236fb420c9d2b8986593464fc3a980e69 11-Jun-2013 Dmitry Shmidt <dimitrysh@google.com> Merge "softap: Add channel configuration parameter"
cc729d09ff04a51a5d6ca265a67d223720cc83ca 10-Jun-2013 Geremy Condra <gcondra@google.com> Merge "Add netd support for marked packet forwarding"
9b5f76c81e06c513779f049e2d7fca2ae7b3e057 10-Jun-2013 Geremy Condra <gcondra@google.com> Merge "Add netd binds for UID based routing"
85e6c5f00bef0e23f81904bc8a430498a545f4f6 10-Jun-2013 Dmitry Shmidt <dimitrysh@google.com> softap: Add channel configuration parameter

Bug: 9372353

Change-Id: Id85a8a41f644195519f1635e4ab73806b5e1738e
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
oftapController.h
9928ec59ba0ca24d3fee2f2725bb07b6c17bcd87 08-Jun-2013 Chad Brubaker <cbrubaker@google.com> Add netd binds for clearing DNS interface maps

Add resolver clearifacemapping to clear both the uidrange => interface DNS map
and the pid => interface DNS map

Change-Id: I144f4d092780b532633d8a956f68a6888d46797a
ommandListener.cpp
esolverController.cpp
esolverController.h
69f74f372fad2875f94d1ac093c3f1ba86e6f4c2 31-May-2013 Chad Brubaker <cbrubaker@google.com> Add netd binds for setting per uid dns interfaces

Change-Id: I1029232adbd754246c75fbd97c6d720e7e60ced8
ommandListener.cpp
esolverController.cpp
esolverController.h
7a6ce4bed8569745798bcc26f51d6f306ebdba94 07-Jun-2013 Chad Brubaker <cbrubaker@google.com> Add netd support for marked packet forwarding

Add binds in netd for setting up fwmark rules to be used with the per
uid marking to do per uid routing.

Change-Id: Id4f315dd1aec73f074e233c2e3f70eb24b4c537a
ommandListener.cpp
econdaryTableController.cpp
econdaryTableController.h
9a50889a22c1d93c9e1a14873cde8fc1508f66fd 01-Jun-2013 Chad Brubaker <cbrubaker@google.com> Add netd binds for UID based routing

Add methods for add per uid mark rules to push all traffic from specific
uids to specific interfaces.
Allows for per uid routing for per uid VPNs.

Change-Id: I8492c668e2c96010b0f74ea7e367f0b4471238ad
ommandListener.cpp
econdaryTableController.cpp
econdaryTableController.h
3acdb064d8d5a86b1973fcda1e8dd83e0e12e0b3 31-May-2013 Chad Brubaker <cbrubaker@google.com> Update DnsProxy to use resolv's uid->interface map

If a proccess does not have an interface associated with its pid it will
check if there is one associated with its uid before falling back to
using the default interface.

Change-Id: Ife732aa5ae6c3f79ea9ec1e3a63ef8877ad3d494
nsProxyListener.cpp
nsProxyListener.h
0b73d66921bd70ed94b2501c67d444a1ba2e4ed4 17-Apr-2013 Dmitry Shmidt <dimitrysh@google.com> softap: Fix open network creation in case of obsolete parameter

Change-Id: If4ddb6b2e14e6b20fe4fa378d0dfba4e733a58a4
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
eb59b57432c65b034d1360803c881c08a318c4d0 16-Apr-2013 Dmitry Shmidt <dimitrysh@google.com> softap: Add option for hidden SSID

Change-Id: I7bcc43b47e3bcc208f9da81970b9ecb6ce08d778
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
30a74c24514a1771a7181c5b3142d35a20d8c76f 14-Apr-2013 Jeff Johnson <jjohnson@codeaurora.org> am d5b19ca2: Enable 802.11g hardware mode in hostapd.conf

* commit 'd5b19ca2060d66027dd97610c1d0934e90081c64':
Enable 802.11g hardware mode in hostapd.conf
d5b19ca2060d66027dd97610c1d0934e90081c64 12-Apr-2013 Jeff Johnson <jjohnson@codeaurora.org> Enable 802.11g hardware mode in hostapd.conf

The current hostapd.conf generated by SoftapController does not
contain a hw_mode setting. As a result hostapd defaults to 802.11b
mode. This mode is inconsistent with the setting "ieee80211n=1" and
prevents hostapd from using 802.11g/n rates. Add "hw_mode=g" to the
generated hostapd.conf to allow 802.11g/n rates to be advertised and
used.

Change-Id: Ifd66da3f3ffdfffb7c28e751d20bc432e070b2c3
oftapController.cpp
d673d5ab7d114e2140ba4ada5d515c7f57371120 12-Apr-2013 Lorenzo Colitti <lorenzo@google.com> am 37f2e371: Set accept_ra to 2 on all interfaces

* commit '37f2e371c43588ca3661584a79b6544de345189a':
Set accept_ra to 2 on all interfaces
37f2e371c43588ca3661584a79b6544de345189a 11-Apr-2013 Lorenzo Colitti <lorenzo@google.com> Set accept_ra to 2 on all interfaces

Currently, we set accept_ra to 2 (accept RAs even if forwarding
is on) only on wifi and ethernet, but not on other interfaces
like mobile. This breaks IPv6 over mobile on Nexus 7 3G and
all other devices where the IPv6 default route is configured via
RA, because as soon as we start 464xlat (which enables
forwarding) their default route goes away.

Rather than require all manufacturers to update their RILs to
set the flag themselves, set it ourselves at netd startup time.

Bug: 8276725
Change-Id: If066bb1aa3ff211da0a0bbe8d58d5a7f35298580
nterfaceController.cpp
nterfaceController.h
895e638646f08e3230fbb44ea762e92ccf3866e3 10-Apr-2013 Ying Wang <wangying@google.com> am 1d181624: Add liblog

* commit '1d1816247e9fec69b5c0a85d71837fb30dfc6cb3':
Add liblog
1d1816247e9fec69b5c0a85d71837fb30dfc6cb3 10-Apr-2013 Ying Wang <wangying@google.com> Add liblog

Bug: 8580410
Change-Id: Icc2632b33153b01c0d9a15245b3f7e8c89b816ec
ndroid.mk
b348c28ad5a7c69414d36958b3c8fd1873d8ba38 28-Mar-2013 Robert Greenwalt <rgreenwalt@google.com> am 855a369c: Merge "Remove Broadcom hack for BT reverse Tether" into jb-mr2-dev

* commit '855a369cb048973bc8b973232ff56d9273b9dc8b':
Remove Broadcom hack for BT reverse Tether
855a369cb048973bc8b973232ff56d9273b9dc8b 28-Mar-2013 Robert Greenwalt <rgreenwalt@google.com> Merge "Remove Broadcom hack for BT reverse Tether" into jb-mr2-dev
6222d86f7ca198bd80f1f29f89215e2cb0e2dcd7 18-Aug-2012 Robert Greenwalt <rgreenwalt@google.com> Remove Broadcom hack for BT reverse Tether

Plumb it in through binder calls between the external BT stack and
the BluetoothTetheringDataTracker.

bug:8445208
Change-Id: Ice7dfb0b50c9481d359aed14a51372878185171c
ommandListener.cpp
etherController.cpp
etherController.h
6866f92ebb45f634e38df7404e2c6f6a662d3011 18-Mar-2013 JP Abgrall <jpa@google.com> am 36971a68: TetherController: fix "tether blabla list" commands handling

* commit '36971a687bf3a6edc2bf5af8a8b2a3176e7d4691':
TetherController: fix "tether blabla list" commands handling
36971a687bf3a6edc2bf5af8a8b2a3176e7d4691 18-Mar-2013 JP Abgrall <jpa@google.com> TetherController: fix "tether blabla list" commands handling

And "interface list" doesn't accept the extra args anymore.

Bug: 5327568
Change-Id: I3d2cb5d790b74a013edfc10dfe7a544e9e39f0ff
ommandListener.cpp
ac371f3786a3417363cb29bd6a2258ab901c3952 17-Mar-2013 JP Abgrall <jpa@google.com> am 20f95ed9: TetherController: fix "tether interface list" command handling

* commit '20f95ed9db048261c18bbeb152d3204d9cbb58f1':
TetherController: fix "tether interface list" command handling
20f95ed9db048261c18bbeb152d3204d9cbb58f1 16-Mar-2013 JP Abgrall <jpa@google.com> TetherController: fix "tether interface list" command handling

It still silently accepts the extra argument.

Bug: 5327568
Change-Id: I4ac1bdb0e2d33133b3d5dbe11f6f94d503a28d11
ommandListener.cpp
6555f1f8e978c5c522f551314dc26f44401f947d 15-Mar-2013 JP Abgrall <jpa@google.com> am 659692a5: NAT: Disable FORWARD by default and set postroute before FORWARD.

* commit '659692a56cca02822a43b792baba2632d39eb739':
NAT: Disable FORWARD by default and set postroute before FORWARD.
a9d3a3525f30e46d9cf82ffc8e32e25fc53caeff 15-Mar-2013 JP Abgrall <jpa@google.com> am 4ae80dea: NatController: refactor some code wrt sequences of commands

* commit '4ae80dea9cbf1fe1b33037aeb5feb04daeba8ee0':
NatController: refactor some code wrt sequences of commands
659692a56cca02822a43b792baba2632d39eb739 15-Mar-2013 JP Abgrall <jpa@google.com> NAT: Disable FORWARD by default and set postroute before FORWARD.

[Adaptation from https://android-review.googlesource.com/#/c/50223 ]

For NAT table, only the first packet of data flow
hits the rules in this table. If forward is
enabled before postrouting in NAT, packet may be
forwarded without hit rules in NAT table. Phone
will not get responses for such packets because
source IP address is not translated.
How to reproduce:
1) Enable usb tethering;
2) Start ping test on PC;
3) Disable data on Phone;
4) NAT is disabled since data service is lost;
5) Enable data on Phone;
6) Ping can not recover on PC;
7) Capture tcpdump data on phone, source IP
Address is not translated for ICMP packets.
Test result:
Run steps 1-5 in "How to reproduce", Ping session
on PC can be recovered after data is enabled.
CQ00027191

Change-Id: I1c3bcbb3d69eb7e2f61d720fa17086ee0da22fa0
atController.cpp
4ae80dea9cbf1fe1b33037aeb5feb04daeba8ee0 15-Mar-2013 JP Abgrall <jpa@google.com> NatController: refactor some code wrt sequences of commands

This will help when adding/removing commands.

Change-Id: I154fb3d7064acddc3e067d60f225ecab6ea57ddb
atController.cpp
atController.h
75b3e82bce243f9b4da1a02ed89a44fe19a4742f 11-Mar-2013 Jean-Baptiste Queru <jbq@google.com> am 9a0ae9b7: (-s ours) am 484bdcab: am 63790dce: am 42b4c508: (-s ours) am 11ff695d: (-s ours) Reconcile with jb-mr1-release - do not merge

* commit '9a0ae9b77dd8d886faa93b7360277e09417ba11c':
9a0ae9b77dd8d886faa93b7360277e09417ba11c 11-Mar-2013 Jean-Baptiste Queru <jbq@google.com> am 484bdcab: am 63790dce: am 42b4c508: (-s ours) am 11ff695d: (-s ours) Reconcile with jb-mr1-release - do not merge

* commit '484bdcab1e7e64c2ad6ee36b9d216dbc94e82608':
484bdcab1e7e64c2ad6ee36b9d216dbc94e82608 11-Mar-2013 Jean-Baptiste Queru <jbq@google.com> am 63790dce: am 42b4c508: (-s ours) am 11ff695d: (-s ours) Reconcile with jb-mr1-release - do not merge

* commit '63790dce7a791ef575ea80d69776324e15ecf701':
63790dce7a791ef575ea80d69776324e15ecf701 11-Mar-2013 Jean-Baptiste Queru <jbq@google.com> am 42b4c508: (-s ours) am 11ff695d: (-s ours) Reconcile with jb-mr1-release - do not merge

* commit '42b4c5083b168c6780b95e5c60b49655b049d56f':
42b4c5083b168c6780b95e5c60b49655b049d56f 11-Mar-2013 Jean-Baptiste Queru <jbq@google.com> am 11ff695d: (-s ours) Reconcile with jb-mr1-release - do not merge

* commit '11ff695d526735306e1868b596212aac9f3239f4':
11ff695d526735306e1868b596212aac9f3239f4 11-Mar-2013 Jean-Baptiste Queru <jbq@google.com> Reconcile with jb-mr1-release - do not merge
fd46e31ab9f956dae558ba31988b221843d9746b 05-Mar-2013 Lorenzo Colitti <lorenzo@google.com> am cfd1a582: Set accept_ra to 2 when enabling IPv6.

* commit 'cfd1a58237c5fe84ddd30c9a73dd361697060aed':
Set accept_ra to 2 when enabling IPv6.
e53963cf2aa547e7aa6c7ceb88d74abee2ad6ab4 05-Mar-2013 Lorenzo Colitti <lorenzo@google.com> am 70afde6a: Move IPv6 code to InterfaceController.

* commit '70afde6ad9b5fce63cca594ac9b230d2fc9b21ee':
Move IPv6 code to InterfaceController.
cfd1a58237c5fe84ddd30c9a73dd361697060aed 05-Mar-2013 Lorenzo Colitti <lorenzo@google.com> Set accept_ra to 2 when enabling IPv6.

The default value of accept_ra causes the kernel to accept
Router Advertisements only if forwarding is off. This causes
problems with clatd, which uses IPv6 forwarding on a tun
interface, and it may cause problems with IPv6 tethering when
we implement it.

Fix this by setting accept_ra to 2, which accepts RAs regardless
of whether forwarding is on.

Bug: 8276725
Change-Id: Ifee0ceaa68ce438a845fa2d7f3b76c60857114a0
nterfaceController.cpp
70afde6ad9b5fce63cca594ac9b230d2fc9b21ee 04-Mar-2013 Lorenzo Colitti <lorenzo@google.com> Move IPv6 code to InterfaceController.

Bug: 8276725
Change-Id: Ia04fb64d3660eb08d8b32209bf689c5c5e6dd9ac
ommandListener.cpp
ommandListener.h
nterfaceController.cpp
nterfaceController.h
etdConstants.cpp
etdConstants.h
938ab2acc65ea12e84d66e5bc3f8166482d2165b 28-Feb-2013 Sasha Levitskiy <sanek@google.com> Stricter signatures to match the new bionic/libc/netbsd/resolv ones.

Change-Id: I690858b85303addc030540bce8512ec9a1e18b4a
ommandListener.cpp
esolverController.cpp
esolverController.h
c3020dd826b4b763f61aaf3780a69b139c88277e 23-Feb-2013 Sasha Levitskiy <sanek@google.com> Netd: Remove an obsolete API: interface get[rt]xcounter

Change-Id: I6b113294b46e5988ad606144c3eef3c846ac28d1
ommandListener.cpp
ommandListener.h
52b17bcfdf63a9d00f3ab1bc6ff738cbc4d30b0b 22-Feb-2013 Nick Kralevich <nnk@google.com> Don't use client passed PID

Don't assume the client is telling the truth about their PID.
Always take their PID directly from the socket, which is
guaranteed by the kernel to be accurate.

Change-Id: Id3374306fd7043da22065921bd49aced60df32f5
nsProxyListener.cpp
nsProxyListener.h
109899bc63139c5260cb9a7dc409f92efaf2c4b7 13-Feb-2013 JP Abgrall <jpa@google.com> BandwidthController: fixup insertion pos in costly chain handling

* Long time ago, setting an alert in a costly_<iface> chain required adding
it just before the ACCEPT rule that was at the end.
But since then the ACCEPT rule has been removed.
This would cause the insert to pick the last position no matter what.
Now we just append.

* A naughty app in the penalty box could waste up quota on packets that would
get dropped in the later penalty_box rule.
Now we check the penalty_box before feeding it to the quota.

Change-Id: Id4b6a7c020583f1cccc7dccde34c4b85d0fd9642
andwidthController.cpp
andwidthController.h
c8dc63b14f5bcef34a23061c17d3bbe66df51429 14-Feb-2013 JP Abgrall <jpa@google.com> BandwidthController: correctly handle the iptables command exit code

The return code from android_fork_execvp() needed to be massaged because
a status ptr was passed in.

Bug: 8185095
Change-Id: I205884f09b563dd729423a74f22fd5b8c2d59c64
andwidthController.cpp
001f0a436e9fe0353dccd98ee34b91095d9ed1a1 31-Jan-2013 Rom Lemarchand <romlem@google.com> Replace system_nosh call with android_fork_execvp

Replace the system_nosh call with the android_fork_execvp from
liblogwrap.

Change-Id: Idfbc6bcf0bef16d4ee90d6af6bd4b07bc79913bb
ndroid.mk
dletimerController.cpp
dletimerController.h
atController.cpp
atController.h
etdConstants.h
econdaryTableController.cpp
econdaryTableController.h
ogwrapper.c
em_iptables_hook.cpp
838ef6491794900731760aecc1d4a10bb2fdd2ec 25-Jan-2013 Rom Lemarchand <romlem@google.com> Replacing fork_and_execve with liblogwrap call

Using the android_fork_exec call from liblogwrap rather than a
custom fork_and_execve.

Change-Id: If8f9a5442e5e3cfc887010268c360e55e733aef0
etdConstants.cpp
etdConstants.h
ogwrapper.c
dbff348178ebc6f1a9e1b543bd41ace9ec1d2163 07-Feb-2013 JP Abgrall <jpa@google.com> Merge "netd: BandwidthController: Allow tracking loopback interfaces"
3052c0788e1893cdf6f8fc54cc1047434f59d220 07-Feb-2013 Robert Greenwalt <rgreenwalt@google.com> Merge "dns cache per interface iteration 2"
2d4610ec34cc78799a3353638fa05ee53276892a 23-Aug-2011 Mattias Falk <mattias.falk@sonyericsson.com> dns cache per interface iteration 2

support for attach/detach a process (pid) to a
dns cache.
lookup associated dns cache based on the pid
handle pid and interface argument for getaddrinfo
and gethostbyaddress

bug:5465296
Change-Id: I4832c792d22aceabb0481c548003a1fd879c12e4
ommandListener.cpp
nsProxyListener.cpp
nsProxyListener.h
DnsSdListener.cpp
esolverController.cpp
esolverController.h
92009c8effc75c2d70a6c9a1ac33ba2c60b78820 07-Feb-2013 JP Abgrall <jpa@google.com> netd: BandwidthController: Allow tracking loopback interfaces

In the past, loopback interfaces were of no use for bandwidth/datausage.
We now don't treat loopback interfaces any differently.
This will helps with CTS tests that checking the kernel's qtaguid functionality
and the matching user-space handling.

Change-Id: If307ceebc10f89269d1b051f666ec666e5e38d41
andwidthController.cpp
0894b1cf502bc1824bc38368d7c6a21d71cc73dc 31-Jan-2013 Rom Lemarchand <romlem@google.com> Merge "Replace custom logwrapper implementation with liblogwrap"
14150215fcd9060c25a25930e85057df5904f6f6 24-Jan-2013 Rom Lemarchand <romlem@google.com> Replace custom logwrapper implementation with liblogwrap

Use liblogwrap to provide logwrapper functionality instead of
using netd's own implementation.

Change-Id: I10e69aa95989f77c63b5b36825ee7c77fba48c88
ndroid.mk
andwidthController.cpp
andwidthController.h
ogwrapper.c
0fd826ad04979b9f3f8ddc304adb59d544d02ce1 19-Jan-2013 Robert Greenwalt <rgreenwalt@google.com> Merge "Revert "dns cache per interface iteration 2""
1ed5ae0c4959c6f6270b35e56ec6446f37def3a3 19-Jan-2013 Robert Greenwalt <rgreenwalt@google.com> Revert "dns cache per interface iteration 2"

This reverts commit 1c0a243bc22d69d32b758fd3da09ccc902c26225

Change-Id: I63d563df01b4bdc69a11037b1d72fdb4de5437db
ommandListener.cpp
nsProxyListener.cpp
nsProxyListener.h
esolverController.cpp
esolverController.h
e1c5dcad5bcb0e4448341f871097d01e865069de 17-Jan-2013 Robert Greenwalt <rgreenwalt@google.com> Merge "dns cache per interface iteration 2"
99aad1638af75b40d48bf4e88ef499da3014f0ea 15-Jan-2013 Sasha Levitskiy <sanek@google.com> Removed Throttle Controller as obsolete

Change-Id: I1a3c0e1a8690d0d5a8fb1411c49bc6db52ce5ccb
ndroid.mk
ommandListener.cpp
hrottleController.cpp
hrottleController.h
88455313cca4a75f5fdac54a2971043b5813236b 14-Jan-2013 Robert Greenwalt <rgreenwalt@google.com> am 3911886e: am d67cc366: resolved conflicts for merge of b40c2385 to jb-mr1.1-dev

* commit '3911886e854d31058e7d3a6e310e8eafd06c02e0':
Fix a TOCTOU and symlink attack in netd.
3911886e854d31058e7d3a6e310e8eafd06c02e0 14-Jan-2013 Robert Greenwalt <rgreenwalt@google.com> am d67cc366: resolved conflicts for merge of b40c2385 to jb-mr1.1-dev

* commit 'd67cc366f769a84f56755b12d2c943113ec46f8c':
Fix a TOCTOU and symlink attack in netd.
d67cc366f769a84f56755b12d2c943113ec46f8c 14-Jan-2013 Robert Greenwalt <rgreenwalt@google.com> resolved conflicts for merge of b40c2385 to jb-mr1.1-dev

Change-Id: I0cef2141487ffd2cb5694a10e4077c299d9d7df7
b40c2385c7ef44fa0f2369a5378b539dc29c2779 14-Jan-2013 Robert Greenwalt <rgreenwalt@google.com> resolved conflicts for merge of 7b90f090 to jb-mr1-dev

Change-Id: Id5b6598b20f34b5e8d2c90927d2acfae7237e69b
7b90f090d9e48e76d5fb3f674eb7bfd5fbdfaf7d 14-Jan-2013 Robert Greenwalt <rgreenwalt@google.com> am 43682d94: Fix a TOCTOU and symlink attack in netd.

* commit '43682d9474a2c89ddecc9fcc818df40e4f5424ee':
Fix a TOCTOU and symlink attack in netd.
1c0a243bc22d69d32b758fd3da09ccc902c26225 23-Aug-2011 Mattias Falk <mattias.falk@sonyericsson.com> dns cache per interface iteration 2

support for attach/detach a process (pid) to a
dns cache.
lookup associated dns cache based on the pid
handle pid and interface argument for getaddrinfo
and gethostbyaddress

Change-Id: I325788973ad76beb1ada8f5fa6f52f9a94c08dd1
bug:5465296
ommandListener.cpp
nsProxyListener.cpp
nsProxyListener.h
esolverController.cpp
esolverController.h
25753d500d9ef6ee04dad43ffa27287a6dc959ac 10-Jan-2013 Sasha Levitskiy <sanek@google.com> A rough cleanup of netd/softap

- Added error code propagation
- Added more elaborate error messages
- Added stricter parameter checking in softap fwreload
- Cleaned up class signatures
- Removed a non-working default AP in setSoftap
- Removed obsolete functions:
- int addParam(int pos, const char *cmd, const char *arg);
- int setCommand(char *iface, const char *fname, unsigned buflen=0);
- Removed unused "softap clients" functionality
- Removed unused hostapd communication socket

Change-Id: Iad05069f6547f4b17481991018707d5f9db2500a
Signed-off-by: Alexander Levitskiy <sanek@google.com>
ommandListener.cpp
oftapController.cpp
oftapController.h
3d4c7585e35a93d9608fce8cc056b7eee9123a53 11-Dec-2012 Robert Greenwalt <rgreenwalt@google.com> Inform dnsmasq of the downstream ifaces.

This lets it filter the dns requests so we're not a public dns forwarder/spambot.

bug:7530468
Change-Id: I102fad738aff717e6ac40d4ac5a8d39a6fe2d2ca
etherController.cpp
etherController.h
43682d9474a2c89ddecc9fcc818df40e4f5424ee 30-Nov-2012 Robert Greenwalt <rgreenwalt@google.com> Fix a TOCTOU and symlink attack in netd.

Bug: 7530471
Change-Id: I3b0a38a203bdeba6c492a54fded056a16992e34e
oftapController.cpp
85b01890b9c71be6f4e332f3718acc113a554253 30-Nov-2012 Robert Greenwalt <rgreenwalt@google.com> am 80436522: am e0644327: Fix a TOCTOU and symlink attack in netd.

* commit '80436522e8d027ddb31afada47fc2109b8afde8a':
Fix a TOCTOU and symlink attack in netd.
80436522e8d027ddb31afada47fc2109b8afde8a 29-Nov-2012 Robert Greenwalt <rgreenwalt@google.com> am e0644327: Fix a TOCTOU and symlink attack in netd.

* commit 'e0644327ffb203e0b45f3192fd888831902e267c':
Fix a TOCTOU and symlink attack in netd.
e0644327ffb203e0b45f3192fd888831902e267c 29-Nov-2012 Robert Greenwalt <rgreenwalt@google.com> Fix a TOCTOU and symlink attack in netd.

Bug: 7530471
Change-Id: I01fc79d647831dea903e4b852b874eb7bbed25fb
oftapController.cpp
389d24acfad38b59609d97f18dbcd3411c9c11b8 16-Nov-2012 Robert Greenwalt <rgreenwalt@google.com> Merge "Pass dns domain info to resolver."
dd3e46758b500d5e8c61ed30f7402e8538df7e06 13-Nov-2012 Robert Greenwalt <rgreenwalt@google.com> Pass dns domain info to resolver.

bug:6799630
Change-Id: I2e1eb75562a7fba005f830ef1350386b9924a8a3
ommandListener.cpp
esolverController.cpp
esolverController.h
6079e79e6d95187aaf9d818d8d6b85b9ade85ccd 14-Nov-2012 jp abgrall <jpa@google.com> am ce68e2bf: Merge "Launch android-clat via netd"

* commit 'ce68e2bf2679ca90899d36ada62b78689d256fbe':
Launch android-clat via netd
ce68e2bf2679ca90899d36ada62b78689d256fbe 14-Nov-2012 jp abgrall <jpa@google.com> Merge "Launch android-clat via netd"
75b061a2146f16629cfaa5560e0ec0d70f306110 14-Nov-2012 JP Abgrall <jpa@google.com> Revert "Launch android-clat via netd"

This reverts commit 72d85556ec238f537de412ac69bbf43342e02d0c.

AOSP has caught up. Original author has prepared an updated version
of this.
ndroid.mk
latdController.cpp
latdController.h
ommandListener.cpp
ommandListener.h
esponseCode.h
0da73fcecc30140439f856118056df8908609627 20-Jun-2012 Daniel Drown <dan-android@drown.org> Launch android-clat via netd

This patch adds the commands: "clatd start [interface]", "clatd stop", and
"clatd status"

Change-Id: I4b041d1f13c25108476621d2e2a1e5bac69841f5
Signed-off-by: Daniel Drown <dan-android@drown.org>
Depends-on: If2bc6916fc66fd4bca7cc241c83cfae839b82e15
ndroid.mk
latdController.cpp
latdController.h
ommandListener.cpp
ommandListener.h
esponseCode.h
72d85556ec238f537de412ac69bbf43342e02d0c 14-Nov-2012 Daniel Drown <dan-android@drown.org> Launch android-clat via netd

This patch adds the commands: "clatd start [interface]", "clatd stop", and
"clatd status"

Change-Id: I4b041d1f13c25108476621d2e2a1e5bac69841f5
Signed-off-by: Daniel Drown <dan-android@drown.org>
Depends-on: If2bc6916fc66fd4bca7cc241c83cfae839b82e15
ndroid.mk
latdController.cpp
latdController.h
ommandListener.cpp
ommandListener.h
esponseCode.h
f280dc1d7c865f3a04ff656786f0abb9b08f622f 06-Nov-2012 The Android Open Source Project <initial-contribution@android.com> am f072e3d2: (-s ours) am a108106e: Reconcile with jb-mr1-factory-release jb-mr1-release - do not merge

* commit 'f072e3d20531ca452a51bd45f863abb23f2e3968':
f072e3d20531ca452a51bd45f863abb23f2e3968 06-Nov-2012 The Android Open Source Project <initial-contribution@android.com> am a108106e: Reconcile with jb-mr1-factory-release jb-mr1-release - do not merge

* commit 'a108106eb489a5e2b657d0afc63872334ba0f791':
a108106eb489a5e2b657d0afc63872334ba0f791 06-Nov-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with jb-mr1-factory-release jb-mr1-release - do not merge

Change-Id: I0a50c89812fb0f6e635a02ed4c9db690d749e3cf
c39bcb00a3c791998163e9f1d4d72fccdf48ca3e 24-Sep-2012 The Android Open Source Project <initial-contribution@android.com> am a3103f9f: (-s ours) Reconcile with jb-mr1-release - do not merge

* commit 'a3103f9fe060e91fd6de0975ebe31ddeed88a9e4':
a3103f9fe060e91fd6de0975ebe31ddeed88a9e4 24-Sep-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with jb-mr1-release - do not merge

Change-Id: I73a0aeb8cfaf12e12eee1b5d6f9549ef24895f62
d553ad32eb1d4fa3c02c0ca1aebb5e09fe0c2760 21-Sep-2012 The Android Automerger <android-build@android.com> merge in jb-mr1-release history after reset to jb-mr1-dev
d377572797492ee0d87876a37fa0065b5d3626a1 20-Sep-2012 Zhihai Xu <zhihaixu@google.com> am bdb84a1e: am 0b02d05f: remove Pan service which is not used anymore.

* commit 'bdb84a1eb0bbb75648c4761c797fd179a5e1e893':
remove Pan service which is not used anymore.
bdb84a1eb0bbb75648c4761c797fd179a5e1e893 20-Sep-2012 Zhihai Xu <zhihaixu@google.com> am 0b02d05f: remove Pan service which is not used anymore.

* commit '0b02d05f1e2968643c42d10841dccedb63d33c48':
remove Pan service which is not used anymore.
0b02d05f1e2968643c42d10841dccedb63d33c48 19-Sep-2012 Zhihai Xu <zhihaixu@google.com> remove Pan service which is not used anymore.

because we replaced bluez bluetooth stack with bluedroid bluetooth stack.
This is multiple project check-in for ISSUE 6849488 Bluedroid stack, remove system/bluetooth.
Pan service depend on system/bluetooth. So both Pan service and system/bluetooth should be removed.

bug 6849488

Change-Id: I7a5a828b9b4327dbd6b6a13ec7ff4a9129ba0ca5
ndroid.mk
ommandListener.cpp
ommandListener.h
anController.cpp
anController.h
esponseCode.h
3d35d2661351ecce8beabdf17c8cbac4ed03c937 13-Sep-2012 The Android Open Source Project <initial-contribution@android.com> am c2203765: (-s ours) Reconcile with jb-mr1-release - do not merge

* commit 'c2203765ea773939cc1a3fe3a77d887c91d0719b':
1a474d0e5c08ea8fedef967ca516db07431260bd 13-Sep-2012 jp abgrall <jpa@google.com> am ddf62a13: am 40cdfe48: am 78b00d81: Merge "Don\'t include <linux/...> header files directly."

* commit 'ddf62a13a066039782e4cb67c256b1489c46ed1f':
Don't include <linux/...> header files directly.
3c644f5847d15bb7081efbb8c50400af3a16bd00 13-Sep-2012 Sasha Levitskiy <sanek@google.com> am e0f6082c: am 87482aa6: Demoting a non-critical error to a warning: unable to load net cmd dll.

* commit 'e0f6082cf6f08c180ee2ef9fa90830068ff40804':
Demoting a non-critical error to a warning: unable to load net cmd dll.
c2203765ea773939cc1a3fe3a77d887c91d0719b 12-Sep-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with jb-mr1-release - do not merge

Change-Id: I75192a980be37fe14baa5ee2cd5a69452c161b5e
51a95096f752f772e509e0fbe2195026fb5e4872 12-Sep-2012 The Android Automerger <android-build@android.com> merge in jb-mr1-release history after reset to jb-mr1-dev
ddf62a13a066039782e4cb67c256b1489c46ed1f 12-Sep-2012 jp abgrall <jpa@google.com> am 40cdfe48: am 78b00d81: Merge "Don\'t include <linux/...> header files directly."

* commit '40cdfe48dbf95d4cef7bbd47bd0c0e72f72bd390':
Don't include <linux/...> header files directly.
40cdfe48dbf95d4cef7bbd47bd0c0e72f72bd390 12-Sep-2012 jp abgrall <jpa@google.com> am 78b00d81: Merge "Don\'t include <linux/...> header files directly."

* commit '78b00d81ebb7e2720fe17c116bcfd086bdd1f4e7':
Don't include <linux/...> header files directly.
78b00d81ebb7e2720fe17c116bcfd086bdd1f4e7 12-Sep-2012 jp abgrall <jpa@google.com> Merge "Don't include <linux/...> header files directly."
970274a61800e047430d81269df977de9dbe45ef 12-Sep-2012 Elliott Hughes <enh@google.com> Don't include <linux/...> header files directly.

These change from kernel release to release, and no longer contain some of
the stuff you need.

Change-Id: I3fc7176cf2246aebfc0aa2a833dfa04ea8d931fc
esolverController.cpp
econdaryTableController.h
etherController.h
e0f6082cf6f08c180ee2ef9fa90830068ff40804 11-Sep-2012 Sasha Levitskiy <sanek@google.com> am 87482aa6: Demoting a non-critical error to a warning: unable to load net cmd dll.

* commit '87482aa6d64b835ce8f6485fd5b0953d939ed94f':
Demoting a non-critical error to a warning: unable to load net cmd dll.
87482aa6d64b835ce8f6485fd5b0953d939ed94f 11-Sep-2012 Sasha Levitskiy <sanek@google.com> Demoting a non-critical error to a warning: unable to load net cmd dll.

Bug: 7141069
Change-Id: Ib4326f80fd562d845095bad38f45ceb9f3be119e
nterfaceController.cpp
f2f4e7a536ed92bedf8aed07eaf3b68459b99986 09-Sep-2012 The Android Automerger <android-build@android.com> merge in jb-mr1-release history after reset to jb-mr1-dev
4ef3436e3c2164fcc2ae5e66945229ec5fde9c3c 07-Sep-2012 Jeff Sharkey <jsharkey@android.com> am 3504ab45: am bec6d04e: Add LOG_TAG to NetdConstants.

* commit '3504ab455dba256138da9447fee1d150e18274cc':
Add LOG_TAG to NetdConstants.
3504ab455dba256138da9447fee1d150e18274cc 07-Sep-2012 Jeff Sharkey <jsharkey@android.com> am bec6d04e: Add LOG_TAG to NetdConstants.

* commit 'bec6d04e1a84823b89e5581ea8ebcf9f08915216':
Add LOG_TAG to NetdConstants.
bec6d04e1a84823b89e5581ea8ebcf9f08915216 07-Sep-2012 Jeff Sharkey <jsharkey@android.com> Add LOG_TAG to NetdConstants.

Bug: 7114117
Change-Id: Ifef2cfca6c1361f89ac68eead58df70efc58a8a7
etdConstants.cpp
4489eba50bbf4bf03fecff227048993b41506ed7 22-Aug-2012 The Android Open Source Project <initial-contribution@android.com> am eeca586b: (-s ours) Reconcile with jb-mr1-release - do not merge

* commit 'eeca586bda0411d162307e1581e9308f5173592e':
eeca586bda0411d162307e1581e9308f5173592e 22-Aug-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with jb-mr1-release - do not merge

Change-Id: Ic385ef16d6d685014334b320ddb7f1929c34bfd3
88b58dc4f13e6cad92f4f77927e410029aefeed9 21-Aug-2012 The Android Automerger <android-build@android.com> merge in jb-mr1-release history after reset to jb-mr1-dev
aea450e82fd8c5558e9164cbeec84916401f3d1c 20-Aug-2012 Jean-Baptiste Queru <jbq@google.com> am 025aecc7: am 6e38211b: am 8a3da263: Merge "Fix race condition in pthread_create()"

* commit '025aecc7180d09b73220c1218fcc002d00f2d6a2':
Fix race condition in pthread_create()
025aecc7180d09b73220c1218fcc002d00f2d6a2 20-Aug-2012 Jean-Baptiste Queru <jbq@google.com> am 6e38211b: am 8a3da263: Merge "Fix race condition in pthread_create()"

* commit '6e38211b93d37a599dcab1f24d95e4cdc0cd77f9':
Fix race condition in pthread_create()
6e38211b93d37a599dcab1f24d95e4cdc0cd77f9 20-Aug-2012 Jean-Baptiste Queru <jbq@google.com> am 8a3da263: Merge "Fix race condition in pthread_create()"

* commit '8a3da263f9fde42efbc54d19465ebd1f83ba35cd':
Fix race condition in pthread_create()
8a3da263f9fde42efbc54d19465ebd1f83ba35cd 20-Aug-2012 Jean-Baptiste Queru <jbq@google.com> Merge "Fix race condition in pthread_create()"
0cdb680c7648b0f48e6513926cb0a06d290a5cbe 05-Jul-2012 Jurijs Oniscuks <jurijs.oniscuks@sonymobile.com> Fix race condition in pthread_create()

Do not send "&this->mThread" to pthread_create() as newly
created thread can "delete this" before pthread_create() saves
thread id. This would lead to heap corruption.

Change-Id: I9c4cd5e1002b85985514a36ae542778a783db6fb
nsProxyListener.cpp
nsProxyListener.h
2788887b2363be0f12b43ab2c6fa8c31906876d3 15-Aug-2012 The Android Open Source Project <initial-contribution@android.com> am d2c65351: (-s ours) Reconcile with jb-mr1-release - do not merge

* commit 'd2c653514cd77fc8ce73c4da40ac9e2a9d4a74f5':
d2c653514cd77fc8ce73c4da40ac9e2a9d4a74f5 15-Aug-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with jb-mr1-release - do not merge

Change-Id: I4f97bffedf3712fd3c7e07a797d54735a2c456c1
63f0b01812d3ce058b36eee1fd0ea9fa2676a0b0 13-Aug-2012 The Android Automerger <android-build@android.com> merge in jb-mr1-release history after reset to jb-mr1-dev
19f0e138d0e7f4f1233db4086f04214fd288d919 11-Aug-2012 Haoyu Bai <bhy@google.com> am a4d40d29: am 5c4faf76: Fix idletimer iptable rules.

* commit 'a4d40d299c0cc8e60f9729ae81d8012ce9c9edbf':
Fix idletimer iptable rules.
a4d40d299c0cc8e60f9729ae81d8012ce9c9edbf 11-Aug-2012 Haoyu Bai <bhy@google.com> am 5c4faf76: Fix idletimer iptable rules.

* commit '5c4faf7602de0268aa09a3a525b427f83d617b5c':
Fix idletimer iptable rules.
5c4faf7602de0268aa09a3a525b427f83d617b5c 27-Jul-2012 Haoyu Bai <bhy@google.com> Fix idletimer iptable rules.

Now idletimer should be triggered by every packet.

Cherry-picked from commit 8c54ec5de3818ff0c0cfc735c817be2516454415 in
master. DO NOT MERGE

Change-Id: I48e6fed5cb48edc51b5fbe87091e5dbb3f862cb7
ommandListener.cpp
dletimerController.cpp
dletimerController.h
8c54ec5de3818ff0c0cfc735c817be2516454415 27-Jul-2012 Haoyu Bai <bhy@google.com> Fix idletimer iptable rules.

Now idletimer should be triggered by every packet.

Change-Id: I8cc7c40ed9eb71ff6e7627ee9482c7e228d80f38
ommandListener.cpp
dletimerController.cpp
dletimerController.h
cb05eb33692b7cfe913c338f7c8606c1edb32912 07-Aug-2012 JP Abgrall <jpa@google.com> Merge "TetherController: Use correct exit() after fork()+failed exec()."
ce4f37979316dacf99d5bd3298e870bd35d14aac 06-Aug-2012 JP Abgrall <jpa@google.com> TetherController: Use correct exit() after fork()+failed exec().

The bluetooth hack I98a1c8aedfa042b1824de7d8c69f2600c9bfcf29 uses the
wrong exit() after the exec() fail.
This will have undesirable effects like cpp destructors and atexit() funcs
being invoked which could have undesirable effects for the parent.
Also fixed other prior instance of fork()+exec()+"return"

Change-Id: I8c09472a371640a710c55fc18e020b9c152bf9cc
etherController.cpp
01da3942da5e0703c8aede1657f67e6adc74ccf3 06-Aug-2012 The Android Open Source Project <initial-contribution@android.com> am 8359c213: (-s ours) Reconcile with jb-mr1-release - do not merge

* commit '8359c2138a4e6bad5340cc3d17160aa035f185b4':
8359c2138a4e6bad5340cc3d17160aa035f185b4 06-Aug-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with jb-mr1-release - do not merge

Change-Id: I2301113fa097ebe2ac744def2795a257290025b6
718748c19780ade268023f638bfaee4fa2934f39 06-Aug-2012 The Android Automerger <android-build@android.com> merge in jb-mr1-release history after reset to jb-mr1-dev
f68fcec168d7f2126b8d774628c4368f56dd6b76 03-Aug-2012 Sasha Levitskiy <sanek@google.com> am 329c3b46: Changes the interface command API from static lib to a dynamic one

* commit '329c3b4681e2ca4831adc7c8cf257e9e32971710':
Changes the interface command API from static lib to a dynamic one
329c3b4681e2ca4831adc7c8cf257e9e32971710 31-Jul-2012 Sasha Levitskiy <sanek@google.com> Changes the interface command API from static lib to a dynamic one

Change-Id: I9116491a3f5dfc4590ffab367a224fde37a4fd50
ndroid.mk
nterfaceController.cpp
nterfaceController.h
eb5634370b7644c3419c608c2c37b3eaa2dc5f82 31-Jul-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with jb-mr1-release

Change-Id: Iba2b369e6c6e79c79ca38617bb5ff58edcbface2
006feb0aafa681b3f90eca8cafe80caeab8101f4 30-Jul-2012 The Android Automerger <android-build@android.com> merge in jb-mr1-release history after reset to jb-mr1-dev
103e6090bc8350b93ff4486c0b37e8b70e7d9db8 28-Jul-2012 Haoyu Bai <bhy@google.com> Merge "Fix idletimer iptable rules."
2eab1f762badb7ba46b95716e62ea4548a979903 27-Jul-2012 Dmitry Shmidt <dimitrysh@google.com> netd: Add initial interface driver command support

Change-Id: I1d34e43fc6a3336d0cd06e9db1069467382f210f
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ndroid.mk
ommandListener.cpp
ommandListener.h
nterfaceController.cpp
nterfaceController.h
f85a796e02f12f740098513dac8ec63289d31ddb 27-Jul-2012 Haoyu Bai <bhy@google.com> Fix idletimer iptable rules.

Now idletimer should be triggered by every packet.

Change-Id: I6c6ea70cb9b37a58dcb0fd8e88df5f987e5ef150
ommandListener.cpp
dletimerController.cpp
dletimerController.h
ad5b41fae92f20fa9fff334c459dd400de0b8285 20-Jul-2012 Nick Kralevich <nnk@google.com> ndc: get rid of arbritrary command length limit

Change-Id: I6123aa916a1f69bbfba58c26e6f150dfdec8c991
etherController.cpp
dc.c
b082c588930301464981a796f2f28d17df2a2f5e 18-Jul-2012 Haoyu Bai <bhy@google.com> Merge "Changed format of interface class acitivity message."
72779ad68ae5d2151d15a30791ca7203f3cb3026 17-Jul-2012 Jeff Sharkey <jsharkey@android.com> Merge "Introduce basic firewall controls."
d8c64026aaae5a9987151b719bd840ec7d68747a 14-Jul-2012 Jeff Sharkey <jsharkey@android.com> Introduce basic firewall controls.

Creates a separate firewall chain that can be used to allow/deny
traffic based on rules.

Firewall is disabled by default. When enabled, it supports four
types of rules: allowing traffic based on iface name, based on egress
source IP, based on egress destination IP and port, and based on
local UID.

Bug: 5756357
Change-Id: I97f894dca6bddb93b3c56478c5297f79d727cdab
ndroid.mk
ommandListener.cpp
ommandListener.h
irewallController.cpp
irewallController.h
db28cbecc5cddae4dff740a299d311f18ddea523 17-Jul-2012 Haoyu Bai <bhy@google.com> Changed format of interface class acitivity message.

For the sake of consistency, format of interface class activity message
is changed to "NNN IfaceClass <active/idle> <label>" and using single
response code for interface class activity.

Change-Id: I34dc5c37cc611d05172060b2a1e4ceac0a0f0588
etlinkHandler.cpp
esponseCode.h
1994410a3df367c7ce1083dc3f226c8ab68f4fdc 13-Jul-2012 Matthew Xie <mattx@google.com> HACK: Need to startup dhcpd for non-system bluetooth stack

Add TODO comments to remove start/stopReverseTethering
Return error code with exit() in child process in startReverseTethering
when executing dhcpcd fails.
This is needed so we can get BT certification.
The cleanup is tracked in stopship b/6820232

Change-Id: I98a1c8aedfa042b1824de7d8c69f2600c9bfcf29
etherController.cpp
9caaa44f635f86200e2b9b4cd36d1471ce910a6a 21-Jun-2012 Matthew Xie <mattx@google.com> change logx to alogx

Change-Id: Ib535b04a6b18d5d35012795b07a705c6483f343d
ommandListener.cpp
etherController.cpp
9589a4c6e0b6a5ec60c65b248e7deff2805749b2 15-Apr-2012 zzy <zhenye@broadcom.com> Added bluetooth reverse tether start/stop cmd
ommandListener.cpp
etherController.cpp
etherController.h
8e188ed5c989ddcc07f0f5e9839493c22d17e7b6 13-Jul-2012 Jeff Sharkey <jsharkey@android.com> Consolidate iptables chain management.

Move creation and management of module iptables chains up into
CommandListener, which gives better visibility into ordering.

Change-Id: If0c94187c6e59a20840b035d7241057f45a0f74b
andwidthController.cpp
andwidthController.h
ommandListener.cpp
dletimerController.cpp
dletimerController.h
atController.cpp
atController.h
etdConstants.cpp
etdConstants.h
ogwrapper.c
em_iptables_hook.cpp
em_iptables_hook.h
90f374a7f4b111eeb1ed19feb52350c8f32c169d 30-Jun-2012 Haoyu Bai <bhy@google.com> Merge "Add a class lable parameter to idletimer."
98f65d32b1530b4da6050e38d52f955710577efb 29-Jun-2012 Haoyu Bai <bhy@google.com> Add a class lable parameter to idletimer.

Now the idletimer should be setup by this command:
ndc idletimer add <interface> <timeout> <class label>

Class label can be a number or string to identify device type, such as
mobile or wifi. Idletimer will send label in the netd message instead
of the actual interface name.

Change-Id: Ic8b69dc5e38a4436c74723697905643a1214aa2a
ommandListener.cpp
dletimerController.cpp
dletimerController.h
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.h
esponseCode.h
778ffe4d3dcab5453b57a0d960ea7f066374b953 20-Jun-2012 Dmitry Shmidt <dimitrysh@google.com> netd: interface: Allow setcfg command without addresses

Change-Id: I47ebe05b2f3daf9754b4baf2e62d46dea76f67b1
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ommandListener.cpp
d0daeab8e89e7fcc97cfcce701db45c07aa7ab52 20-Jun-2012 Irfan Sheriff <isheriff@google.com> Merge "Clean up softap interface"
7e9eb7b48345af69283afa7ca58d3be0a329931b 16-Jun-2012 Irfan Sheriff <isheriff@google.com> Clean up softap interface

Remove old IOCTL based interface

Change-Id: I5c46964d025848ce8a0e0195ff213ccd8b33d508
ndroid.mk
ommandListener.cpp
oftapController.cpp
oftapController.h
4f931639b8d4fd92db16431d97e3fd18feb477f9 15-Jun-2012 Jean-Baptiste Queru <jbq@google.com> am 9997f9a3: resolved conflicts for merge of e36a3a2f to jb-dev-plus-aosp

* commit '9997f9a3edac2baac244c2fe8e49685a3be9f482':
Run dnsmasq with options --keep-in-foreground and --pid-file.
9997f9a3edac2baac244c2fe8e49685a3be9f482 15-Jun-2012 Jean-Baptiste Queru <jbq@google.com> resolved conflicts for merge of e36a3a2f to jb-dev-plus-aosp

Change-Id: I566b0e96327f318313c17a11d35539554b075f59
e36a3a2f998a62b0bf61d1ffff4a752746163cf4 14-Jun-2012 Jean-Baptiste Queru <jbq@google.com> Merge "Run dnsmasq with options --keep-in-foreground and --pid-file."
158e8f3613093fdf7b146cab89b08e8dc457a903 04-Jun-2012 Jeff Sharkey <jsharkey@android.com> am c9ed2f47: (-s ours) Allow additional interface flags. Do not merge

* commit 'c9ed2f4706fa46e41a6ebbcd9a529d75c1ac84c5':
Allow additional interface flags. Do not merge
c9ed2f4706fa46e41a6ebbcd9a529d75c1ac84c5 02-Dec-2011 Jeff Sharkey <jsharkey@android.com> Allow additional interface flags. Do not merge

Cherry-pick from master to fix b/6537483

Bug: 5686458
Change-Id: I9c5147446636d32bb3a420a05199870cca5f013d
ommandListener.cpp
033f07ad2e328f40c44cdd253f4cce872c357e3c 16-May-2012 The Android Open Source Project <initial-contribution@android.com> am 034ed176: Reconcile with jb-release nakasi-factoryrom-release

* commit '034ed1763cf10f060f73d10ee6b4abef896fc3ef':
Do not send extra data the client is not consuming.
034ed1763cf10f060f73d10ee6b4abef896fc3ef 16-May-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with jb-release nakasi-factoryrom-release

Change-Id: I51d86c45479eb7be5e06325d344a6d1c21fd5247
0a998cb37a2fb29f5db56150502dda10a47c8156 09-May-2012 JP Abgrall <jpa@google.com> am 40baed83: netd: NetlinkHandler: explicitly ignore "platform" and "backlight" events

* commit '40baed83f89e8d8f834cdfa94d0615076463c04b':
netd: NetlinkHandler: explicitly ignore "platform" and "backlight" events
c9e67914ac128f3e3ef5241388be1d9089af6a63 09-May-2012 JP Abgrall <jpa@google.com> am 29e8de22: BandwidthController: Fix double counting

* commit '29e8de22ad806bdcaa971ffeeb360c9f908aa346':
BandwidthController: Fix double counting
ae0effefd54bb836e6d1efaf02bf78c7e8573e0b 09-May-2012 JP Abgrall <jpa@google.com> am b1d24094: BandwidthController: Avoid setting a uid multiple times in NaughtyApps

* commit 'b1d24094c2c5d48bbb3dfad4a0551ff0bf77ce6c':
BandwidthController: Avoid setting a uid multiple times in NaughtyApps
52a236ff2ff5c908bdf56d579852e0195962bfe9 09-May-2012 JP Abgrall <jpa@google.com> am f66d6e9d: BandwidthController: hookup qtaguid for tracking closest to devices.

* commit 'f66d6e9db6be3e94b80c59fab99e237d2e2968c5':
BandwidthController: hookup qtaguid for tracking closest to devices.
cef54c42c914900e17ec820054dbf85eca225063 09-May-2012 The Android Automerger <android-build@android.com> merge in jb-release history after reset to jb-dev
40baed83f89e8d8f834cdfa94d0615076463c04b 08-May-2012 JP Abgrall <jpa@google.com> netd: NetlinkHandler: explicitly ignore "platform" and "backlight" events

The new vsync api uses uevents to notify userspace... 60 events/sec. :(
Don't log unexpected event's subsystem if it is one of the known ones.

Change-Id: Ie900898b326c9451b76ac5f6ba047870fd62093a
etlinkHandler.cpp
b756f69226d86380ea88b9330356c9fd210dbafe 08-Sep-2011 Peter Nilsson <peter6.nilsson@sonyericsson.com> Run dnsmasq with options --keep-in-foreground and --pid-file.

Tell dnsmasq to run with option --keep-in-foreground instead
of --no-daemon, which is meant for debug purposes only. Also
use option --pid-file to tell dnsmasq not use a pid file.

Change-Id: I82858d911e94407b2511d8ce8388be553f2f09f6
etherController.cpp
29e8de22ad806bdcaa971ffeeb360c9f908aa346 03-May-2012 JP Abgrall <jpa@google.com> BandwidthController: Fix double counting

Only have qtaguid only count in the bw_INPUT/bw_OUTPUT chains
and not in the costly_* subchains.
We don't use --goto anymore.

Change-Id: I2eded2e0fa12b46843d32e74406cfeda85f242d1
andwidthController.cpp
a315f96c9346428e3de2edf0bb98074b0bf7bc92 30-Apr-2012 The Android Automerger <android-build@android.com> merge in jb-release history after reset to jb-dev
36efb737ff145cc7b6741080cef4472adae2728c 27-Apr-2012 JP Abgrall <jpa@google.com> am e07effe6: netd: Netlink: Use KOBJECT_UEVENT instead of IDLETIMER

* commit 'e07effe6f8e9340dbee9428b29672adfb647c413':
netd: Netlink: Use KOBJECT_UEVENT instead of IDLETIMER
9e4f02bdcf8f4646645c3b8d9a0f6e7ee4d18e92 27-Apr-2012 JP Abgrall <jpa@google.com> am ad729ac1: bandwidthcontroller: hide iptables errors when they don\'t matter

* commit 'ad729ac11e080b1f1bdd9cd32807d9ae74ce2a63':
bandwidthcontroller: hide iptables errors when they don't matter
ff28f8a7dd279cef6506b3f06abad0436b2ad67d 27-Apr-2012 JP Abgrall <jpa@google.com> am e4c501c3: netd: NatController: don\'t setup iptables hooks in constructor.

* commit 'e4c501c3a78f21d6d6e4ff0ba9090185cff1be8c':
netd: NatController: don't setup iptables hooks in constructor.
b1d24094c2c5d48bbb3dfad4a0551ff0bf77ce6c 27-Apr-2012 JP Abgrall <jpa@google.com> BandwidthController: Avoid setting a uid multiple times in NaughtyApps

Use the naughtyAppUids list before inserting a new app.

Bug: 6292513
Change-Id: I6726b7d589569a6198b8a0ff32c32c0e40ed5319
andwidthController.cpp
f66d6e9db6be3e94b80c59fab99e237d2e2968c5 27-Apr-2012 JP Abgrall <jpa@google.com> BandwidthController: hookup qtaguid for tracking closest to devices.

Before, qtaguid would rely on netdev (up/down) callbacks to read out the
dev rx/tx stats.
Now it uses (raw) PREROUTING and (mangle) POSTROUTING iptable hooks.
We use mangle on the out path because nat is not available in ipv6.
The NatController only masquerades in nat POSTROUTING so we don't count
traffic that might get dropped.


Bug: 5444089
Change-Id: I997b8b3c81264a545f1f575baaf0445c0afc8f72
andwidthController.cpp
e07effe6f8e9340dbee9428b29672adfb647c413 27-Apr-2012 JP Abgrall <jpa@google.com> netd: Netlink: Use KOBJECT_UEVENT instead of IDLETIMER

The initial idletimer support required using NETLINK_IDLETIMER
netlink socket type.
Instead we now just re-use the existing KOBJECT_UEVENT socket.

Change-Id: I951f2f29182c7cf7f29a054a0eabc88dc25f6d1f
etlinkHandler.cpp
etlinkManager.cpp
ad729ac11e080b1f1bdd9cd32807d9ae74ce2a63 25-Apr-2012 JP Abgrall <jpa@google.com> bandwidthcontroller: hide iptables errors when they don't matter

Some commands are run to be able to recover after failures.
Those cleanup commands are generally allowed to fail.
But the lower level system commands would log an error.
Now that error is hidden if nobody will care about the result.
A "#define LOG_NDEBUG 0" will show those failing commands.

Removed leftover LOG_NDEBUG in CommandListener.

Bug: 6377175
Change-Id: I1205fb077f7d0496969bd2a0b5da42025bc5a8dc
andwidthController.cpp
andwidthController.h
ommandListener.cpp
e4c501c3a78f21d6d6e4ff0ba9090185cff1be8c 25-Apr-2012 JP Abgrall <jpa@google.com> netd: NatController: don't setup iptables hooks in constructor.

iptables top-level chain updates should happen within CommandListener()
when it invokes the various modules' setupIptablesHooks().
And remove the extra DROP rule.

Change-Id: I33d2cfbd5444516f855ff85152c472352944cc77
atController.cpp
11337e830010122e9f68e3b3708fd84b6513a30e 25-Apr-2012 The Android Automerger <android-build@android.com> merge in jb-release history after reset to jb-dev
1fb02dfc26e06b83e756ab3538b7ebc2136f535d 25-Apr-2012 JP Abgrall <jpa@google.com> bandwidthcontroller: hide iptables errors when they don't matter

Some commands are run to be able to recover after failures.
Those cleanup commands are generally allowed to fail.
But the lower level system commands would log an error.
Now that error is hidden if nobody will care about the result.
A "#define LOG_NDEBUG 0" will show those failing commands.

Removed leftover LOG_NDEBUG in CommandListener.

Bug: 6377175
Change-Id: I1205fb077f7d0496969bd2a0b5da42025bc5a8dc
andwidthController.cpp
andwidthController.h
ommandListener.cpp
458f318280c3b98d84958c63899c949c71612b1a 25-Apr-2012 JP Abgrall <jpa@google.com> netd: NatController: don't setup iptables hooks in constructor.

iptables top-level chain updates should happen within CommandListener()
when it invokes the various modules' setupIptablesHooks().
And remove the extra DROP rule.


Change-Id: I33d2cfbd5444516f855ff85152c472352944cc77
atController.cpp
73be1adb3b1a63185b97ecc9c61ae75a7994ee86 24-Apr-2012 Robert Greenwalt <rgreenwalt@google.com> Merge "Store certain MDNS fields as quoted strings"
70ecc6341661b831794519497d53c8fcfe98c64c 23-Apr-2012 The Android Automerger <android-build@android.com> merge in jb-release history after reset to master
4833e47bb886db80cf4ec23a00cc4ba2a1f113e7 20-Apr-2012 Robert Greenwalt <rgreenwalt@google.com> Store certain MDNS fields as quoted strings

They sometimes contain spaces so a space-delimited response requires more care.

bug: 6353048
Change-Id: I84d5cc156bf4d9f1419b7202e9aa00ddb7209b2f
DnsSdListener.cpp
0031cead820149e2fe3ccb3cc2fe05758a3cb5c2 18-Apr-2012 JP Abgrall <jpa@google.com> netd: Idletimer vs Nat vs Bandwidth controllers

* modified iptables users to work in controller specific custom chains.
- each controller only works withing his own custom chains and not the
top level ones (INPUT, OUTPUT, FORWARD, POSTROUTING,...)
- CommandListener now invokes setupIptablesHooks() for each controller
once. That is the only time they are allowed to access the top-level
chains.

* Added idletimer controller.
From https://android-git.corp.google.com/g/#/c/180769/2
- supported commands
. ndc idletimer enable
. ndc idletimer add <iface> <timeout>
. ndc idletimer remove <iface> <timeout_used_during_add>
There is a framework change elsewhere that receives netlink messages.

Signed-off-by: Ashish Sharma <ashishsharma@google.com>
Signed-off-by: JP Abgrall <jpa@google.com>
Change-Id: Ia57450c09166ce20f21d1e3b49047ef1e98f2a3d
ndroid.mk
andwidthController.cpp
andwidthController.h
ommandListener.cpp
ommandListener.h
dletimerController.cpp
dletimerController.h
atController.cpp
atController.h
etdConstants.cpp
etdConstants.h
6df79da87b57437505eedd7fdf5359f9e67c38dd 19-Apr-2012 Jeff Sharkey <jsharkey@android.com> Add "metered" flag to DHCP offer vendor info.

Bug: 6344821
Change-Id: Ic8cd235a1cbdd848ff839f6f0f03161de2090751
etherController.cpp
f0389ca9cc38a9891fa95d1be3e1df73b4fecf9c 16-Apr-2012 The Android Automerger <android-build@android.com> merge in jb-release history after reset to master
745e09fc5694e73920aaad18a626275597bdddb1 29-Mar-2012 Robert Greenwalt <rgreenwalt@google.com> Initial release of mdns interface.

Uses extern/mdnsresponder and communicate with the framework via nativedaemonconnector.

Change-Id: I5c090528197afa090836d7cb5bf75dfba33ff11c
ndroid.mk
DnsSdListener.cpp
DnsSdListener.h
esponseCode.h
ain.cpp
dc.c
6337b88ce4438d224819e9b381ddaf2873bbfdda 11-Apr-2012 Ashish Sharma <ashishsharma@google.com> netd: Add support for interface idletimer netlink notifications.

Change-Id: Ifda5b8ecf68533eea42b133dbe0a581b4401ab11
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.cpp
etlinkManager.h
esponseCode.h
b146ae64bda6f82b390323b6586b4f37b981572b 03-Apr-2012 Mike Lockwood <lockwood@google.com> Merge remote-tracking branch 'goog/ics-aah'
2b0215e32609749c897247200ea21cf8d28af8e2 21-Mar-2012 The Android Open Source Project <initial-contribution@android.com> am 19ac8238: am 99c65114: Reconcile with ics-mr1-release

* commit '19ac823851c7f8691d5aecbc5a0149ba72ed806c':
19ac823851c7f8691d5aecbc5a0149ba72ed806c 21-Mar-2012 The Android Open Source Project <initial-contribution@android.com> am 99c65114: Reconcile with ics-mr1-release

* commit '99c65114b976fd8ceb54021cede0dd63f8826a02':
99c65114b976fd8ceb54021cede0dd63f8826a02 21-Mar-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with ics-mr1-release

Change-Id: I6cf64c289005dccb3d60c972686b7c335aa015a4
628b804692d10b53ad40a635811e9f28e0028f5c 21-Mar-2012 The Android Open Source Project <initial-contribution@android.com> am d7a9ff6d: am 17654593: Reconcile with ics-mr1-release

* commit 'd7a9ff6ddc2895d298598e53cf7b967742e0d4da':
d7a9ff6ddc2895d298598e53cf7b967742e0d4da 21-Mar-2012 The Android Open Source Project <initial-contribution@android.com> am 17654593: Reconcile with ics-mr1-release

* commit '176545930d60a366734bbf70c3b60332a606c01e':
176545930d60a366734bbf70c3b60332a606c01e 21-Mar-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with ics-mr1-release

Change-Id: If53997c291c7c51332b57f572fbbfc70f7527166
4e2ec226d09f2ffbddc873eb6e42135e4e756de3 21-Mar-2012 The Android Automerger <android-build@android.com> merge in jb-release history after reset to master
093e3c70de6caa21cc004db868fe2a9c1055661a 16-Mar-2012 Dmitry Shmidt <dimitrysh@google.com> softap: Remove wmm_enabled=1 flag from SoftAP config

Change-Id: Id2b43001d95259fbaf25108bf95dfae3802b79bf
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
690540e756068fd663524a2993a0bdbb1b3bd0aa 12-Mar-2012 The Android Automerger <android-build@android.com> merge in jb-release history after reset to master
3c903b555975fa59d6688a0a6417ac7512c202e7 10-Mar-2012 The Android Automerger <android-build@android.com> merge in ics-mr1-release history after reset to ics-mr1
63db18d9ab1802d56a8f0bb6314d07f0827b9aa3 10-Mar-2012 The Android Automerger <android-build@android.com> merge in ics-mr1-release history after reset to ics-mr1
65359032bce20c3c2cd73c36f2eda11dbadeff54 09-Mar-2012 Selim Gurun <sgurun@google.com> Merge "We are not reverting this CL since it was a temporary fix and we just submitted the proper one."
40e0c13d6b77a9260b6da4c9e11cca8a5f994ea2 09-Mar-2012 Selim Gurun <sgurun@google.com> We are not reverting this CL since it was a temporary fix and we just submitted the proper one.

Revert "Do not send extra data the client is not consuming."

This reverts commit 6217272e1a41fc9827250c675a0499d2091ec6ac
nsProxyListener.cpp
00a7f626ec5e94f5be00e91655a54ffd4fb94ab7 09-Mar-2012 Selim Gurun <sgurun@google.com> Merge "Ignore Sigpipe in netd"
0c6924c18d857c9e76faae8933183e0a064222fc 09-Mar-2012 Dmitry Shmidt <dimitrysh@google.com> Merge "ndc: Add default sequence number to command"
c1044d4507a79166f3cfac9cacf669888f049ea9 09-Mar-2012 Selim Gurun <sgurun@google.com> Ignore Sigpipe in netd

Bug:6141847

Ignore sigpipe in netd. This will enable us remove the temporary
changes in DnsProxyListener that we added to temporarily resolve
issue 6138617.

Change-Id: I4bc13ac0fcf9dd0e7641c2d4459b1eab0ed50f2a
ain.cpp
eca2a7819bf3fbc5fddfda96321c595f5d819d28 09-Mar-2012 The Android Automerger <android-build@android.com> merge in ics-mr1-release history after reset to ics-mr1
3ebc33bd4d29326e0a8cf082b8bc07999ff3a762 09-Mar-2012 Selim Gurun <sgurun@google.com> Do not send extra data the client is not consuming.

Bug:6138617

This is to temporarily fix a problem in netd. In case of an error do
not send extra data that the client is not expecting. This causes a
netd crash.

Change-Id: Iadb375e326577857034c2a7d2e962e4242d4735f
nsProxyListener.cpp
6217272e1a41fc9827250c675a0499d2091ec6ac 09-Mar-2012 Selim Gurun <sgurun@google.com> Do not send extra data the client is not consuming.

Bug:6138617

This is to temporarily fix a problem in netd. In case of an error do
not send extra data that the client is not expecting. This causes a
netd crash.

Change-Id: Iadb375e326577857034c2a7d2e962e4242d4735f
nsProxyListener.cpp
44ec9035d3821f17d185032ed64446cabae266bf 09-Mar-2012 Dmitry Shmidt <dimitrysh@google.com> ndc: Add default sequence number to command

Change-Id: I81ec40b8dd560eb9b6430eafc05d5e7714e0f042
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
dc.c
cd6821f6d334b60537d6d6d5966765a25b0c5ba0 08-Mar-2012 Nick Kralevich <nnk@google.com> am e1176866: am 88ec4ed2: am 1babab9f: netd: do check on command, not buffer.

* commit 'e1176866629c90bc1403926186bf2b7efc736a2a':
e70e9bd68fdccd14cb10b16190e244e089ecb36b 08-Mar-2012 Nick Kralevich <nnk@google.com> am e2f132b7: (-s ours) am 19d7b786: am 1babab9f: netd: do check on command, not buffer.

* commit 'e2f132b7a224d1c2287292132b93f53b09d617cd':
netd: do check on command, not buffer.
5aed6e67ba325d6b9efe1ce5637590a0e3b1a26d 08-Mar-2012 Selim Gurun <sgurun@google.com> Merge "Prevent potential stall on dns proxy operations."
e1176866629c90bc1403926186bf2b7efc736a2a 07-Mar-2012 Nick Kralevich <nnk@google.com> am 88ec4ed2: am 1babab9f: netd: do check on command, not buffer.

* commit '88ec4ed21deb1340675ba026fda46e6183c2e219':
e2f132b7a224d1c2287292132b93f53b09d617cd 07-Mar-2012 Nick Kralevich <nnk@google.com> am 19d7b786: am 1babab9f: netd: do check on command, not buffer.

* commit '19d7b786eed1c69a2d9d6d0764ad9cf8e97b9f72':
netd: do check on command, not buffer.
19d7b786eed1c69a2d9d6d0764ad9cf8e97b9f72 07-Mar-2012 Nick Kralevich <nnk@google.com> am 1babab9f: netd: do check on command, not buffer.

* commit '1babab9febdbd05b7b6d72e0728f49ee8d4b9bd2':
netd: do check on command, not buffer.
88ec4ed21deb1340675ba026fda46e6183c2e219 07-Mar-2012 Nick Kralevich <nnk@google.com> am 1babab9f: netd: do check on command, not buffer.

* commit '1babab9febdbd05b7b6d72e0728f49ee8d4b9bd2':
netd: do check on command, not buffer.
d458176c9ba25d10a27d4265efb5a68ba6bad3be 07-Mar-2012 Nick Kralevich <nnk@google.com> am 1babab9f: netd: do check on command, not buffer.

* commit '1babab9febdbd05b7b6d72e0728f49ee8d4b9bd2':
netd: do check on command, not buffer.
1babab9febdbd05b7b6d72e0728f49ee8d4b9bd2 07-Mar-2012 Nick Kralevich <nnk@google.com> netd: do check on command, not buffer.

Bug: 6132094
Change-Id: I76aef21b07c07db76bbc6587ae732b1ceb4488ce
ogwrapper.c
2e9caa7fd4ace0fbf187cb5e7fe1426693151e0e 07-Mar-2012 Nick Kralevich <nnk@google.com> netd: do check on command, not buffer.

Bug: 6132094
Change-Id: Icb3b0d0b2a0fd795c05162afc8791729bfa5d075
ogwrapper.c
23c40730b49cd6dda04acb9ce2482edfeea2fde7 07-Mar-2012 Glenn Kasten <gkasten@google.com> Merge "Remove reference to hard-coded cpuctl path for bg"
7e6e42e3e67277320299e7325d2ee65f8f1213d6 06-Mar-2012 Robert Greenwalt <rgreenwalt@google.com> Merge "Use the new command numbering scheme."
c4bbfa247dbe4dda17e28694d49afd3ec0b06bad 06-Mar-2012 Glenn Kasten <gkasten@google.com> Remove reference to hard-coded cpuctl path for bg

As part of scheduling policy cleanup, remove/isolate references to the
scheduling policy files and APIs.

In this case, logwrap is not used currently due to bug 5144246, and even
if it were the "background" parameter was 0.

Change-Id: Ibf7fa2617a0e485c9868b22b378636728d16622a
andwidthController.cpp
ppController.cpp
ogwrapper.c
e89a2d1bc67feeb51307e35666df2254f112421f 06-Mar-2012 Mathias Agopian <mathias@google.com> Merge "remove dependency on utils/List.h"
f00db28f37f1b5509598fef586036ff0a52ec30b 06-Mar-2012 Mathias Agopian <mathias@google.com> remove dependency on utils/List.h

Change-Id: I45c7e2cf9fe07f65259af6fa22d719259386912c
ist.h
atController.h
anController.h
ppController.h
oftapController.h
etherController.h
7d16ba20b16cab4cb41b434fd80088e247811130 03-Mar-2012 The Android Open Source Project <initial-contribution@android.com> am 9c2d6591: am c91e3d47: Reconcile with ics-mr1-release

* commit '9c2d659130f57082adafa9c0a86d308cb4fff6e7':
9c2d659130f57082adafa9c0a86d308cb4fff6e7 03-Mar-2012 The Android Open Source Project <initial-contribution@android.com> am c91e3d47: Reconcile with ics-mr1-release

* commit 'c91e3d476a8002fc6e8f994152be5dc4b3b85489':
c91e3d476a8002fc6e8f994152be5dc4b3b85489 03-Mar-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with ics-mr1-release

Change-Id: I94123eabf7bde1c98440858acbddacca8f91c4bb
d0c59ab88e7c449e703aebbb8c137461685d8253 03-Mar-2012 The Android Open Source Project <initial-contribution@android.com> am e03c41b5: am 4d00f912: Reconcile with ics-mr1-release

* commit 'e03c41b50bd4bcfdf8a1c9f965200ab1a783b1d6':
e03c41b50bd4bcfdf8a1c9f965200ab1a783b1d6 03-Mar-2012 The Android Open Source Project <initial-contribution@android.com> am 4d00f912: Reconcile with ics-mr1-release

* commit '4d00f91201adc92d2d7fc56322f264db2fa7c816':
4d00f91201adc92d2d7fc56322f264db2fa7c816 03-Mar-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with ics-mr1-release

Change-Id: I939f27b0ec63aa664bd606bd6ac7af4433d67c18
e0cbe1e9349b1c7ea2ef65ac4fecd3f328f3f456 02-Mar-2012 The Android Automerger <android-build@android.com> merge in ics-mr1-release history after reset to ics-mr1
ddb34755fb54882b3ece8d4919593e26a2c1cfcb 28-Feb-2012 Selim Gurun <sgurun@google.com> Prevent potential stall on dns proxy operations.

Update wire protocol to return and process error code first. This
will make sure dns proxy operations do not stall when an internal
error happens.

Change-Id: I65595abb0638722ccd877f69057bd435ca06e524
nsProxyListener.cpp
esponseCode.h
0cd9ba45680acc2f5c139d7765c135b246d65108 01-Mar-2012 Jaime A Lopez-Sollano <jaimel@quicinc.com> am b7aeeb6c: am 500e77d5: am 3c20787d: Increase the valid name of the iface to IFNAMSIZ

* commit 'b7aeeb6cf2d473639b1a495361d888cbf52ab6c5':
a8e59f8c50aed3f91dead377b8ae21646978506c 16-Feb-2012 Robert Greenwalt <rgreenwalt@google.com> Use the new command numbering scheme.

Support multiple commands on a single socket via command numbers.
Native DaemonConnector has been changed, so we need to use it here
too.

bug:5864209
Change-Id: I084a284db38b996e7965bb9dd18440636eff9801
ommandListener.cpp
4e157a5c901baa020dcc71ca453c31d462272e50 29-Feb-2012 Robert Greenwalt <rgreenwalt@google.com> resolved conflicts for merge of 924e6e4d to master

Change-Id: I98212c9d7004a9ae38e463036ae6ca97b9569dda
b7aeeb6cf2d473639b1a495361d888cbf52ab6c5 29-Feb-2012 Jaime A Lopez-Sollano <jaimel@quicinc.com> am 500e77d5: am 3c20787d: Increase the valid name of the iface to IFNAMSIZ

* commit '500e77d5f596b9ee488ff2cf4309d81525c0d6fd':
924e6e4d36308e65ebdbd4beaf72193768ad3be5 29-Feb-2012 Jaime A Lopez-Sollano <jaimel@quicinc.com> am 7de67315: am 3c20787d: Increase the valid name of the iface to IFNAMSIZ

* commit '7de673157ed86b0ba4705a071380a103c1d1841e':
Increase the valid name of the iface to IFNAMSIZ
7de673157ed86b0ba4705a071380a103c1d1841e 29-Feb-2012 Jaime A Lopez-Sollano <jaimel@quicinc.com> am 3c20787d: Increase the valid name of the iface to IFNAMSIZ

* commit '3c20787d7935c2016e8e3cc49d8f15647c12c41c':
Increase the valid name of the iface to IFNAMSIZ
500e77d5f596b9ee488ff2cf4309d81525c0d6fd 29-Feb-2012 Jaime A Lopez-Sollano <jaimel@quicinc.com> am 3c20787d: Increase the valid name of the iface to IFNAMSIZ

* commit '3c20787d7935c2016e8e3cc49d8f15647c12c41c':
Increase the valid name of the iface to IFNAMSIZ
81d9370690bebbc93c86a288fada73457b95942b 29-Feb-2012 Jaime A Lopez-Sollano <jaimel@quicinc.com> am 3c20787d: Increase the valid name of the iface to IFNAMSIZ

* commit '3c20787d7935c2016e8e3cc49d8f15647c12c41c':
Increase the valid name of the iface to IFNAMSIZ
3c20787d7935c2016e8e3cc49d8f15647c12c41c 12-Jan-2012 Jaime A Lopez-Sollano <jaimel@quicinc.com> Increase the valid name of the iface to IFNAMSIZ

Define MAX_IFACE_LENGTH as IFNAMSIZ instead of 10, to
prevent netd from treating an interface name 'rmnet_sdio0'
as invalid.
Also fix an off-by-one error.

bug:5675718
Change-Id: I2b6ba823c89941031e5898b24dab388cd9c2dae8
atController.cpp
econdaryTableController.cpp
econdaryTableController.h
bcd2f5b830c3b1bbbeb22fb45a17dafb8ead789b 29-Feb-2012 Dmitry Shmidt <dimitrysh@google.com> Merge "netd: softap: Add ieee80211n=1 parameter for hotspot"
fa81a805da643421a5bcb182e7860824532b2776 28-Feb-2012 Dmitry Shmidt <dimitrysh@google.com> netd: softap: Add ieee80211n=1 parameter for hotspot

Change-Id: I73d862494c186a08066d8e3478667055bfc831a1
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
c2b26cb83d9bf3f91e986625efcc40fc8eb79a13 23-Feb-2012 Nick Kralevich <nnk@google.com> BandwidthController: fix format string bugs

In 876666947664c718a8d0cae9bbddb06cc91f912c, a new %s
was added to ALERT_IPT_TEMPLATE. Not all users of this string
were updated.

This change modifies ALERT_IPT_TEMPLATE to be a #define, which
allows gcc's format string detection work.

Add -Werror=format to error out on any string format warning.

Testing: Code compiles. I don't know how to test this change
properly.

Bug: 5948299
Change-Id: I0ec307972e6bf50abd8ba099166c22069a6c6580
ndroid.mk
andwidthController.cpp
andwidthController.h
0a379691e04700b3b44948450b1e3db92ef2ec01 13-Feb-2012 Dmitry Shmidt <dimitrysh@google.com> netd: softap: Add wmm_enabled=1 option

Change-Id: I3742e1130e3d9e3074a67f2e1bdd13ef11bb77dc
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
9ba8522270c907703e377335cdc912c6669eccce 01-Feb-2012 Robert Greenwalt <robdroid@android.com> Merge "Increase the valid name of the iface to IFNAMSIZ"
6e56cddd87f48fd12da4bcf125504906ed936561 01-Feb-2012 The Android Open Source Project <initial-contribution@android.com> am c5c68d7b: am ad8126d0: Reconcile with ics-mr1-release

* commit 'c5c68d7b9b92b0f7f151fec20359ab75ea5fbc34':
c5c68d7b9b92b0f7f151fec20359ab75ea5fbc34 01-Feb-2012 The Android Open Source Project <initial-contribution@android.com> am ad8126d0: Reconcile with ics-mr1-release

* commit 'ad8126d0199af924f8036a81297e1f67c3bba7ab':
ad8126d0199af924f8036a81297e1f67c3bba7ab 01-Feb-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with ics-mr1-release

Change-Id: Ica795e32aa94c9ea21b4a4f2acd84a9979c59c09
d14fd4f83ffeea4ad1cd559a41f775f6814565cc 12-Jan-2012 Jaime A Lopez-Sollano <jaimel@quicinc.com> Increase the valid name of the iface to IFNAMSIZ

Define MAX_IFACE_LENGTH as IFNAMSIZ instead of 10, to
prevent netd from treating an interface name 'rmnet_sdio0'
as invalid.
Also fix an off-by-one error.

Change-Id: If6b2b27d2da6eb72f01c090cbe4f7dc2b9c296ae
atController.cpp
econdaryTableController.cpp
econdaryTableController.h
6db274f1b2d56573adb2e816fc3bc816f1d0707a 01-Feb-2012 Robert Greenwalt <rgreenwalt@google.com> Merge "Keep better tabs on secondary tables."
c462177bd58e3bf0ac4f618934dae060569e3e0b 31-Jan-2012 Robert Greenwalt <rgreenwalt@google.com> Keep better tabs on secondary tables.

We had some places (NatController) where routes were being set
but not accounted for in the number-of-routes talley so we
could end up thinking the table was empty and not clean up
after ourselves properly.

Also consolidated constants.

bug:5917475
Change-Id: I98a41d433e1d4b4ca6692fb2328e2c9afc828145
ndroid.mk
atController.cpp
atController.h
etdConstants.cpp
etdConstants.h
econdaryTableController.cpp
econdaryTableController.h
hrottleController.cpp
em_iptables_hook.cpp
7f442558d163cae1fda57104cbc8ed35a88c8fff 21-Jan-2012 The Android Open Source Project <initial-contribution@android.com> am a201914b: Reconcile with ics-mr1-release

* commit 'a201914b3b2f6910b4ce4d58a4f170d9ebaeb174':
a201914b3b2f6910b4ce4d58a4f170d9ebaeb174 19-Jan-2012 The Android Open Source Project <initial-contribution@android.com> Reconcile with ics-mr1-release

Change-Id: I2e12ef9428b2f10e7cc87199edfa090cb9c7167e
7c73e8951d91b5afe9d52f88d7ed3a09d120a725 19-Jan-2012 JP Abgrall <jpa@google.com> netd: Rename LOGI/LOGE to ALOGI/ALOGE

The merge from ics-mr1 branch pulled in some oldschool LOGE/LOGI calls.

Change-Id: I3c452198375c4cdce085307e844f1d6aa491225b
em_iptables_hook.cpp
053a99cef7b6d87a52216df7845b225703c74462 19-Jan-2012 Kazuhiro Ondo <kazuhiro.ondo@motorola.com> am b210b180: am 4ab46857: Add back hook for inserting OEM specific iptables rules.

* commit 'b210b1806c740bf66eb04eb8e8d8ee75c01652dd':
Add back hook for inserting OEM specific iptables rules.
41c2f3ee4fb15f9fbdc22b163dc97e06e2109a7d 19-Jan-2012 The Android Automerger <android-build@android.com> merge in ics-mr1-release history after reset to ics-mr1
eaad0621a67adbf3e450ef22e234bb7d298b5f29 19-Jan-2012 Kazuhiro Ondo <kazuhiro.ondo@motorola.com> am 4ab46857: Add back hook for inserting OEM specific iptables rules.

* commit '4ab468577647d1ee73810b89d2287eaa5546fecb':
Add back hook for inserting OEM specific iptables rules.
b210b1806c740bf66eb04eb8e8d8ee75c01652dd 19-Jan-2012 Kazuhiro Ondo <kazuhiro.ondo@motorola.com> am 4ab46857: Add back hook for inserting OEM specific iptables rules.

* commit '4ab468577647d1ee73810b89d2287eaa5546fecb':
Add back hook for inserting OEM specific iptables rules.
4ab468577647d1ee73810b89d2287eaa5546fecb 12-Jan-2012 Kazuhiro Ondo <kazuhiro.ondo@motorola.com> Add back hook for inserting OEM specific iptables rules.

The functionality was lost during merge in ICS branch.
This patch is adding back OEM iptables hook in netd.

Bug:5862460
Change-Id: I9444b8c53e8b84fea2002c2c1d9ba42e45ae5f0c
ndroid.mk
andwidthController.cpp
atController.cpp
em_iptables_hook.cpp
em_iptables_hook.h
4da10dd08f12002c3821c5d4ceba302daae33e03 13-Jan-2012 David 'Digit' Turner <digit@google.com> Use <resolv_iface.h> instead of <resolv.h>

The declarations for _resolv_set_default_iface() and others were
initially added to a public C library header (<resolv.h>). This was a
mistake and they have been moved to a private header
(bionic/libc/private/resolv_iface.h)

This patch updates netd to use the correct private header.

Change-Id: I186390ea3675685b4e0dd5b8a099bd21911f059e
ndroid.mk
esolverController.cpp
5ea0c05a1e7d8e664b808aa1bb1efd08fdb2fb13 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: I8ab66debe4d0c3857a4b80f6f7b6925a352cda87
andwidthController.cpp
ommandListener.cpp
atController.cpp
etlinkManager.cpp
anController.cpp
ppController.cpp
econdaryTableController.cpp
oftapController.cpp
etherController.cpp
hrottleController.cpp
ogwrapper.c
ain.cpp
0e76b761a1514d5182675dd7b7d33725f62d6bc5 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: Ic9a12b3bc322d1fa60de50725b5ca18341d64b91
ommandListener.cpp
nsProxyListener.cpp
etlinkHandler.cpp
08b58b60fd70e81317a9df19cc431f0759bc9e71 04-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: I61f544fc5b362863886cadceb37c9840e1d48e9b
ain.cpp
7b984e3f7e724f8a3547a707210319f3d479f261 20-Dec-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I85b946663d5a0e7606140282bf758c27b8c6f68f
ommandListener.cpp
nsProxyListener.cpp
anController.cpp
ppController.cpp
esolverController.cpp
oftapController.cpp
etherController.cpp
ain.cpp
8112c85001dae35f626cfacd22f274f2ce5ffa64 15-Dec-2011 The Android Open Source Project <initial-contribution@android.com> am b6331c31: Reconcile with ics-mr1-release

* commit 'b6331c31fede2d6a898892bdf9e9b34618da9756':
netd: fix argument interpretation bug
b6331c31fede2d6a898892bdf9e9b34618da9756 15-Dec-2011 The Android Open Source Project <initial-contribution@android.com> Reconcile with ics-mr1-release

Change-Id: I95c0b924756d815c89e70c088b6e8003a54226f8
8a12dd0851cc2aaa1f6ffb27e5d7616733200c36 15-Dec-2011 JP Abgrall <jpa@google.com> netd: fix argument interpretation bug

While working around the logwrap() issue, it was replaced with system()
which could lead to various commands getting misinterpreted.

We now use a system() equivalent that doesn't use "sh -c".

Bug:5758556
Change-Id: I2599b526ac34bcfca18d05261286d902d547efda
andwidthController.cpp
atController.cpp
econdaryTableController.cpp
hrottleController.cpp
ogwrapper.c
447dacddaccf9f4b723ca53346349bf2039527f5 15-Dec-2011 JP Abgrall <jpa@google.com> am 9e5e0ce6: netd: fix argument interpretation bug

* commit '9e5e0ce62e88ddf9a09798eda51b0c270d354c8e':
netd: fix argument interpretation bug
a1aa827827d254fbbe60e66476baf130e8dacd00 15-Dec-2011 JP Abgrall <jpa@google.com> am 9e5e0ce6: netd: fix argument interpretation bug

* commit '9e5e0ce62e88ddf9a09798eda51b0c270d354c8e':
netd: fix argument interpretation bug
9e5e0ce62e88ddf9a09798eda51b0c270d354c8e 15-Dec-2011 JP Abgrall <jpa@google.com> netd: fix argument interpretation bug

While working around the logwrap() issue, it was replaced with system()
which could lead to various commands getting misinterpreted.

We now use a system() equivalent that doesn't use "sh -c".

Bug:5758556
Change-Id: I2599b526ac34bcfca18d05261286d902d547efda
andwidthController.cpp
atController.cpp
econdaryTableController.cpp
hrottleController.cpp
ogwrapper.c
7c2ddd84ec501aaedb806a3ecec5de00d618a036 02-Dec-2011 Jeff Sharkey <jsharkey@android.com> Allow additional interface flags.

Bug: 5686458
Change-Id: I9c5147446636d32bb3a420a05199870cca5f013d
ommandListener.cpp
31ea0b03afeedd17f703b7a6d1e5c9feb2d6000d 30-Nov-2011 Jeff Sharkey <jsharkey@android.com> Remove square brackets from interface flags.

All trailing arguments are treated as now treated as flags, instead
of mixing argument formats.

Change-Id: Iab80ed47ce2c8a1e7bc0fc5a46d391638fe282c8
ommandListener.cpp
bae6aaf08c8b3c49d426f3d4ebdb1a0c2d78dd8e 23-Nov-2011 Robert Greenwalt <rgreenwalt@google.com> am 063af322: Fix some syntax issues with IP command.

* commit '063af322b48ab1bb0c3e09eb0b64915ba568275b':
Fix some syntax issues with IP command.
df54b758cf673f28b60f91b813bc56af08e5f895 23-Nov-2011 Robert Greenwalt <rgreenwalt@google.com> am 063af322: Fix some syntax issues with IP command.

* commit '063af322b48ab1bb0c3e09eb0b64915ba568275b':
Fix some syntax issues with IP command.
063af322b48ab1bb0c3e09eb0b64915ba568275b 19-Nov-2011 Robert Greenwalt <rgreenwalt@google.com> Fix some syntax issues with IP command.

Was not building secondary tables properly. Also IPv6 host routes
were failing.

bug:5615697
Change-Id: I0d5ad2ed7d13e4d5bd8c2f8ce15fc0ccb36a4690
atController.cpp
atController.h
econdaryTableController.cpp
econdaryTableController.h
a2a64f004f1677daf16b0b03d589d6572ec547c2 12-Nov-2011 JP Abgrall <jpa@google.com> netd: BandwidthController: return extra info on gettetherstats failure

Use the error message string to report the raw parsed data in case of
failure.

Bug:5543131
Change-Id: If9f3bcea09fd3ab8a506955d8153b3430bfd239c
andwidthController.cpp
andwidthController.h
ommandListener.cpp
29563474fd66b03d5bc5b11bc54cd4001e2327a7 05-Nov-2011 Robert Greenwalt <rgreenwalt@google.com> am fc97b82e: Start using IP tool for advanced routing.

* commit 'fc97b82e02979f246d56a4bfd60e4aab8686d3f6':
Start using IP tool for advanced routing.
2b6c87cf4ef17f7e21fd6f95f91a372f5ec1921f 04-Nov-2011 Robert Greenwalt <rgreenwalt@google.com> am fc97b82e: Start using IP tool for advanced routing.

* commit 'fc97b82e02979f246d56a4bfd60e4aab8686d3f6':
Start using IP tool for advanced routing.
fc97b82e02979f246d56a4bfd60e4aab8686d3f6 03-Nov-2011 Robert Greenwalt <rgreenwalt@google.com> Start using IP tool for advanced routing.

bug:5495862
bug:5396842
Change-Id: I51f21060947f57e63b18c4d35e9d49fac488d48a
ndroid.mk
ommandListener.cpp
ommandListener.h
atController.cpp
atController.h
econdaryTableController.cpp
econdaryTableController.h
47441ce12d8ac4e7f3c3fb1354a3ae50b802c2bd 02-Nov-2011 Robert Greenwalt <rgreenwalt@google.com> am f7bf29c8: When un-natting try to do all we can

* commit 'f7bf29c8a37d65e132a4dceb7c5a4200ed5c3d79':
When un-natting try to do all we can
05c15031c0ed1aee69b618528fa44f7a5aeee976 02-Nov-2011 Robert Greenwalt <rgreenwalt@google.com> am f7bf29c8: When un-natting try to do all we can

* commit 'f7bf29c8a37d65e132a4dceb7c5a4200ed5c3d79':
When un-natting try to do all we can
f7bf29c8a37d65e132a4dceb7c5a4200ed5c3d79 02-Nov-2011 Robert Greenwalt <rgreenwalt@google.com> When un-natting try to do all we can

Regardless of errors we should try to do as much as possible. Sometimes
some steps may fail if interfaces are taken down before we can un-nat them.

bug:5536516
Change-Id: I9c9b0123198dba890565e0a6e4e15add16b369c2
ommandListener.cpp
atController.cpp
674cadbf08fce044dea45d5b3f235f23a66a39bf 28-Oct-2011 Ed Heyl <ed@google.com> keep previous history after reset to mr1 plus aah changes (ics-aah-wip)
c7239a3dcb30b62dfba35b7df7b4d387e517aab2 26-Oct-2011 Ed Heyl <ed@google.com> undo reset to ics-mr1 until we have a better method
14ec1bbd5fc528bb2befa10f9e6bdf44d45d6e46 26-Oct-2011 Ed Heyl <ed@google.com> reset to ics-mr1, but keep history
068c39911794c8a334a4b241a06ffa9673b6a803 26-Oct-2011 Irfan Sheriff <isheriff@google.com> am 8c61917c: am 54b75b4e: Use CCMP for WPA2 mode

* commit '8c61917c11c3b32b37f174265060bb857683ee57':
Use CCMP for WPA2 mode
8c61917c11c3b32b37f174265060bb857683ee57 26-Oct-2011 Irfan Sheriff <isheriff@google.com> am 54b75b4e: Use CCMP for WPA2 mode

* commit '54b75b4e772ac77df141ab077be074bc1c098987':
Use CCMP for WPA2 mode
290fd652399fe9287c1e5c5d527c8712640b2af3 26-Oct-2011 Steve Block <steveblock@google.com> am 3fb42e02: (-s ours) Rename LOGV(_IF) to ALOGV(_IF) DO NOT MERGE

* commit '3fb42e026ffebab2c8f282e42501040121e32d83':
Rename LOGV(_IF) to ALOGV(_IF) DO NOT MERGE
54b75b4e772ac77df141ab077be074bc1c098987 26-Oct-2011 Irfan Sheriff <isheriff@google.com> Use CCMP for WPA2 mode

TKIP+CCMP for WPA and the secure CCMP for WPA2

Bug:5515097
Change-Id: I877d1f4075c3df83149aca23b59c285d2fe093e1
oftapController.cpp
52646a5cd9f624512de942a5c0b4ff2f1c7b28f5 25-Oct-2011 Steve Block <steveblock@google.com> am bf91ebf2: (-s ours) Rename LOG() to ALOG() DO NOT MERGE

* commit 'bf91ebf2e205cca5660c1c9306cc10b4fac653e7':
Rename LOG() to ALOG() DO NOT MERGE
3fb42e026ffebab2c8f282e42501040121e32d83 20-Oct-2011 Steve Block <steveblock@google.com> Rename LOGV(_IF) to ALOGV(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: Iaf07eecf106fda89c464723661976f4570638558
andwidthController.cpp
ommandListener.cpp
bf91ebf2e205cca5660c1c9306cc10b4fac653e7 12-Oct-2011 Steve Block <steveblock@google.com> Rename LOG() to ALOG() DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/141576

Bug: 5449033
Change-Id: I049afb3bf14d5eb5c3cf8dc073113a4854f8ec06
ogwrapper.c
f8b92ffecd0cc4e898baa07225ca6d2f2ff17b41 08-Oct-2011 JP Abgrall <jpa@google.com> am c6c67349: netd: bandwidth: tethering global alert support

* commit 'c6c673496184bed6d62cf92a6fc7ed43fd94acd5':
netd: bandwidth: tethering global alert support
c6c673496184bed6d62cf92a6fc7ed43fd94acd5 08-Oct-2011 JP Abgrall <jpa@google.com> netd: bandwidth: tethering global alert support

Now, when nat is enabled/disabled it will let the bandwidthcontroller
know that it might need to add/remove the matching global alert into
the tethering rules in the FORWARD chain of iptables.

Bug: 5336638
Change-Id: I1843f3f6601f371537f754a31db792e054b36a1d
andwidthController.cpp
andwidthController.h
ommandListener.cpp
a25bf2a4d3ef4722a7b5811f271b3811925eeafc 30-Sep-2011 repo sync <isheriff@google.com> am c1b38701: Add support to disable/enable ipv6

* commit 'c1b3870147acd0dd42e2e767df08b4d64d5d2423':
Add support to disable/enable ipv6
c1b3870147acd0dd42e2e767df08b4d64d5d2423 30-Sep-2011 repo sync <isheriff@google.com> Add support to disable/enable ipv6

Bug: 5388757
Change-Id: I0506254948477cbff05603faed625cc73d94d777
ommandListener.cpp
ommandListener.h
831e0250a4306252e23e02be9e823159cd85bd52 29-Sep-2011 Lorenzo Colitti <lorenzo@google.com> am 1ed47c4a: Move the code to delete IP addresses to ifc_utils.

* commit '1ed47c4a016e420a855ee46922e512150245ff61':
Move the code to delete IP addresses to ifc_utils.
1ed47c4a016e420a855ee46922e512150245ff61 27-Sep-2011 Lorenzo Colitti <lorenzo@google.com> Move the code to delete IP addresses to ifc_utils.

Change-Id: I04c8de503229d1dce6bd08c286b7017eaea11039
ommandListener.cpp
8d616d9aa8ed645d145301c707e14f0f315eb255 19-Sep-2011 JP Abgrall <jpa@google.com> am db7da58e: netd: BandwidthController: support reading out tethering stats

* commit 'db7da58e8d2aa021060098057f944ef754be06e3':
netd: BandwidthController: support reading out tethering stats
db7da58e8d2aa021060098057f944ef754be06e3 18-Sep-2011 JP Abgrall <jpa@google.com> netd: BandwidthController: support reading out tethering stats

* Add
ndc bandwidth gettetherstats <ifaceIn> <ifaceOut>
which returns
221 ifaceIn ifaceOut rx_bytes rx_packets tx_bytes tx_packets
If the iface pair is not found it will fail.

221 is the new response code for TetheringStatsResult.
It gets the stats by looking at the iptables FORWARD chain's counters.

* Fixed return handling after some of the responses.
- no need for errorno
- after ResponseCode >= 200, don't return another.

* Correctly initialize the alert values on "bandwidth enable"

Bug: 5244846,5230066
Change-Id: I81c941441525fa4055ae270d5cad05e6c42b8f72
andwidthController.cpp
andwidthController.h
ommandListener.cpp
ommandListener.h
esponseCode.h
7c38121543fe781c92d6a0267b46e02516e3d56b 15-Sep-2011 Irfan Sheriff <isheriff@google.com> am 65969062: Merge "Netd comand to change IPv6 privacy extensions"

* commit '65969062a94e3a2d15a2536db297492f96a1f0aa':
Netd comand to change IPv6 privacy extensions
65969062a94e3a2d15a2536db297492f96a1f0aa 15-Sep-2011 Irfan Sheriff <isheriff@google.com> Merge "Netd comand to change IPv6 privacy extensions"
32a9dc6f484deb3462d11084caca21e3f1f662b2 14-Sep-2011 Irfan Sheriff <isheriff@google.com> Netd comand to change IPv6 privacy extensions

Bug: 3360737
Change-Id: Ifa13c425c6168acdd01600d49c1fb52288c60d3c
ommandListener.cpp
bfb1992f802db4d03cf25c1488a81f305b2883e7 14-Sep-2011 JP Abgrall <jpa@google.com> am 87666694: netd: BandwidthController: exclude loopback in all alert rules.

* commit '876666947664c718a8d0cae9bbddb06cc91f912c':
netd: BandwidthController: exclude loopback in all alert rules.
876666947664c718a8d0cae9bbddb06cc91f912c 08-Sep-2011 JP Abgrall <jpa@google.com> netd: BandwidthController: exclude loopback in all alert rules.

Have the alerts explicitly request "not loopback".

Change-Id: I7a569292e630c2b8ec76489643741f53ab85b84e
andwidthController.cpp
fee073210cbd534c3f2f86b982a51e1e580e08b6 06-Sep-2011 Irfan Sheriff <isheriff@google.com> am ab374f42: Avoid setting prefix length for 0.0.0.0 address

* commit 'ab374f426a0d1d8598f3eb4b0339440dcb313a1a':
Avoid setting prefix length for 0.0.0.0 address
ab374f426a0d1d8598f3eb4b0339440dcb313a1a 03-Sep-2011 Irfan Sheriff <isheriff@google.com> Avoid setting prefix length for 0.0.0.0 address

The ioctl to set netmask fails when the interface address is 0.0.0.0.
The kernel always keeps the netmask as 0 when the address is 0.0.0.0.
Avoid making a call to prefix length when address is 0.0.0.0

Bug: 5255172
Change-Id: Id32f7823b2230fb9ac7cd45b0df1951f11338112
ommandListener.cpp
3c41d8709f3829d460d6ef645974366beb07d2fd 18-Aug-2011 JP Abgrall <jpa@google.com> am 11b4e9b2: netd: all: use system() instead of logwrap() for now.

* commit '11b4e9b26fe7b878992162afb39f5a8acfd143ed':
netd: all: use system() instead of logwrap() for now.
11b4e9b26fe7b878992162afb39f5a8acfd143ed 12-Aug-2011 JP Abgrall <jpa@google.com> netd: all: use system() instead of logwrap() for now.

The logwrapper uses a blocking read() which does not always
correctly detect when the child process at the other end is gone.
This is a quick workaround for http://b/5144246
A cleaner logwrapper parent() will follow.

Add support for BandwidthController() to use either system() or
logwrap(). It looks at "persist.bandwidth.uselogwrap" to be 0 or 1.

Change-Id: I2d17732214f1a7fef6838eee05d827695b707ab0
Signed-off-by: JP Abgrall <jpa@google.com>
andwidthController.cpp
andwidthController.h
atController.cpp
hrottleController.cpp
5d7a08f497c4ac74416a063a0b13eee44b9988cf 04-Aug-2011 Robert Greenwalt <rgreenwalt@google.com> am 6ccebd08: am e98a5816: am 6e4d5db1: Fix two error-case unwinders.

* commit '6ccebd085f8df439447ffe6060206a0a5af8d448':
Fix two error-case unwinders.
6ccebd085f8df439447ffe6060206a0a5af8d448 04-Aug-2011 Robert Greenwalt <rgreenwalt@google.com> am e98a5816: am 6e4d5db1: Fix two error-case unwinders.

* commit 'e98a581641a233fd048bf76f68650b627ef546e5':
Fix two error-case unwinders.
e98a581641a233fd048bf76f68650b627ef546e5 04-Aug-2011 Robert Greenwalt <rgreenwalt@google.com> am 6e4d5db1: Fix two error-case unwinders.

* commit '6e4d5db1b11f808bb4bdcc8dd45a7158c6c88515':
Fix two error-case unwinders.
6e4d5db1b11f808bb4bdcc8dd45a7158c6c88515 04-Aug-2011 Robert Greenwalt <rgreenwalt@google.com> Fix two error-case unwinders.

Noticed by moto, I missed to calls to actually do the unwinding.

Change-Id: Ie4da4979a3ad0eedcb6d468fecdff6614b1819bd
atController.cpp
5a66a6f5bf601019d5f598be9dc585ba331088a0 02-Aug-2011 Robert Greenwalt <rgreenwalt@google.com> am 49012139: am 69a5b777: am ddb9f6eb: Add DROP rule for INVALID packets.

* commit '49012139e14e5f9cc4e452716e8164c3e7cfd9de':
Add DROP rule for INVALID packets.
49012139e14e5f9cc4e452716e8164c3e7cfd9de 02-Aug-2011 Robert Greenwalt <rgreenwalt@google.com> am 69a5b777: am ddb9f6eb: Add DROP rule for INVALID packets.

* commit '69a5b7777f67f6d5ad9dbd33758332c7b0104613':
Add DROP rule for INVALID packets.
69a5b7777f67f6d5ad9dbd33758332c7b0104613 02-Aug-2011 Robert Greenwalt <rgreenwalt@google.com> am ddb9f6eb: Add DROP rule for INVALID packets.

* commit 'ddb9f6eb8d8c35f46c1e3da68f375b85903e85c9':
Add DROP rule for INVALID packets.
ddb9f6eb8d8c35f46c1e3da68f375b85903e85c9 02-Aug-2011 Robert Greenwalt <rgreenwalt@google.com> Add DROP rule for INVALID packets.

bug:5094583
Change-Id: Ib942c557e7f2694b6ee18cc6562df597165894ce
atController.cpp
3da1ee690754c004f23423f03ec3f46a0232b493 02-Aug-2011 Dmitry Shmidt <dimitrysh@google.com> am 802b7ca3: Merge "softap: Increase delay after driver start to 800 ms (from 400)"

* commit '802b7ca31e62785bf3e181368a2f213260f66cba':
softap: Increase delay after driver start to 800 ms (from 400)
802b7ca31e62785bf3e181368a2f213260f66cba 02-Aug-2011 Dmitry Shmidt <dimitrysh@google.com> Merge "softap: Increase delay after driver start to 800 ms (from 400)"
587d6232b604ee383d893362f37f9843f5ac2162 02-Aug-2011 Dmitry Shmidt <dimitrysh@google.com> softap: Increase delay after driver start to 800 ms (from 400)

Workaround to avoid __nl80211_set_channel() to fail

Change-Id: I710f18c66cff66413f7133d65b2adcf53d67a8e7
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.h
910bd33df8afc97b8207ddff293f6ff99021fab4 30-Jul-2011 Wink Saville <wink@google.com> am 8093c1a0: (-s ours) am 51c1ce04: (-s ours) am 4309f87d: DO NOT MERGE: Update OEM iptable hooks and ip fwd

* commit '8093c1a0aa2eb1c82df07190a24dc224b9f9fd19':
DO NOT MERGE: Update OEM iptable hooks and ip fwd
8093c1a0aa2eb1c82df07190a24dc224b9f9fd19 30-Jul-2011 Wink Saville <wink@google.com> am 51c1ce04: (-s ours) am 4309f87d: DO NOT MERGE: Update OEM iptable hooks and ip fwd

* commit '51c1ce04e8b16f29aa8d9727e65263d8f590c543':
DO NOT MERGE: Update OEM iptable hooks and ip fwd
51c1ce04e8b16f29aa8d9727e65263d8f590c543 30-Jul-2011 Wink Saville <wink@google.com> am 4309f87d: DO NOT MERGE: Update OEM iptable hooks and ip fwd

* commit '4309f87d5baa54a2741f35e0cb09959c55ff1ab6':
DO NOT MERGE: Update OEM iptable hooks and ip fwd
4309f87d5baa54a2741f35e0cb09959c55ff1ab6 30-Jul-2011 Wink Saville <wink@google.com> DO NOT MERGE: Update OEM iptable hooks and ip fwd

This is a squash of two changes from partner repo:

Clean up OEM iptables hooks

Id: Ife7a1c08ca88beba2dede776d2e4dd6097dad05a

And

Add hooks for OEM iptables rules and IP fwd

- Useful for integrating peripherals that use IP for control and
diagnostics.
- Add hooks for specifying static iptables rules at startup.
- Add system prop to keep IP forwarding enabled all the time.
- Remove the ro.bootmode=bp-tools hacks.

Id: Ic70d4c88179c530414505976193bf616037500a6

Bug: 5045218
Change-Id: I4229d3576426880b68ac448f9fbb67f2f8f304a0
atController.cpp
atController.h
etherController.cpp
3bfe0b3cfcfbbf7f3078f53cd5cbc688d54bc34b 29-Jul-2011 JP Abgrall <jpa@google.com> am 6fcb8145: Merge "netd: NetlinkManager: don\'t fail if NETLINK_NFLOG socket is not there."

* commit '6fcb81453c7c759bbbfc5ec2f63205534e7c06e4':
netd: NetlinkManager: don't fail if NETLINK_NFLOG socket is not there.
6fcb81453c7c759bbbfc5ec2f63205534e7c06e4 29-Jul-2011 JP Abgrall <jpa@google.com> Merge "netd: NetlinkManager: don't fail if NETLINK_NFLOG socket is not there."
004e241b4a55aeebb9f9acceda1d26a35e1fba0b 27-Jul-2011 JP Abgrall <jpa@google.com> am afc5f95c: (-s ours) am 59da4baf: (-s ours) am b725a59f: Merge "DO NOT MERGE: NatController: remove flushing the INPUT/OUTPUT tables." into honeycomb-LTE

* commit 'afc5f95c6f18b2efd41b0d8c85377eb70fa396e9':
DO NOT MERGE: NatController: remove flushing the INPUT/OUTPUT tables.
afc5f95c6f18b2efd41b0d8c85377eb70fa396e9 27-Jul-2011 JP Abgrall <jpa@google.com> am 59da4baf: (-s ours) am b725a59f: Merge "DO NOT MERGE: NatController: remove flushing the INPUT/OUTPUT tables." into honeycomb-LTE

* commit '59da4baf881d7f5e2ae82bead547766cbf2c9710':
DO NOT MERGE: NatController: remove flushing the INPUT/OUTPUT tables.
1bb28f46f995a3768c2bb6aafb2fb2bdfb820d6c 27-Jul-2011 Robert Greenwalt <rgreenwalt@google.com> am 7d8c2811: am a45de8a8: Add dns proxy controls from opensource.

* commit '7d8c2811e3604acfd6acfd2f7022919a633b394f':
Add dns proxy controls from opensource.
59da4baf881d7f5e2ae82bead547766cbf2c9710 27-Jul-2011 JP Abgrall <jpa@google.com> am b725a59f: Merge "DO NOT MERGE: NatController: remove flushing the INPUT/OUTPUT tables." into honeycomb-LTE

* commit 'b725a59f3e45de8fcd3c01c512c94ba665acb992':
DO NOT MERGE: NatController: remove flushing the INPUT/OUTPUT tables.
b725a59f3e45de8fcd3c01c512c94ba665acb992 27-Jul-2011 JP Abgrall <jpa@google.com> Merge "DO NOT MERGE: NatController: remove flushing the INPUT/OUTPUT tables." into honeycomb-LTE
8a41209c0188560a3b29c88fab7bd8a480c03892 27-Jul-2011 JP Abgrall <jpa@google.com> netd: NetlinkManager: don't fail if NETLINK_NFLOG socket is not there.

Some kernels used with ICS do not have the needed modules (quota2
with NFLOG support).
For those, we just don't allow NFLOG which will cripple quota alerts.
This is a temp workaround until kernels are prebuilts.


Change-Id: I403ba894aefb67996d791bd06055b8fec97d1407
Signed-off-by: JP Abgrall <jpa@google.com>
etlinkManager.cpp
7d8c2811e3604acfd6acfd2f7022919a633b394f 26-Jul-2011 Robert Greenwalt <rgreenwalt@google.com> am a45de8a8: Add dns proxy controls from opensource.

* commit 'a45de8a8d4def24fbcc21602400214b5ca7ffad1':
Add dns proxy controls from opensource.
d80e94ca116224bf52925a1503ced6f257cb88d6 23-Jun-2011 JP Abgrall <jpa@google.com> DO NOT MERGE: NatController: remove flushing the INPUT/OUTPUT tables.

DO NOT MERGE: cherry-pick from master, as oem's will be updating this
file in HC.

It doesn't use them, so it should not have to flush them.
This is a minimalistic attempt to cooperate with the BandwidthController.

Change-Id: Ia175a86403adf034ac6f44d7ebc4ebe941881368
atController.cpp
a45de8a8d4def24fbcc21602400214b5ca7ffad1 26-Jul-2011 Robert Greenwalt <rgreenwalt@google.com> Add dns proxy controls from opensource.

Port of change 22099 from the opensource.
bug:5060618

Change-Id: Ic99345881fcb30c6f1d5545a32401e6ada865d78
ndroid.mk
ommandListener.cpp
ommandListener.h
esolverController.cpp
esolverController.h
01e182f704b07d0763c0906ab3b706bcf6928896 25-Jul-2011 Dmitry Shmidt <dimitrysh@google.com> wifi: Ensure that entropy file exists

Change-Id: Ib5ea7a6767a4ab7c4244bfc27248ee04340018a7
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
ed4401d0ff90fbb9e43e506ef768439d1f81cae2 25-Jul-2011 JP Abgrall <jpa@google.com> Merge "netd: NetlinkManager: add support receiving quota2 log messages"
000aaef4483752c988ea236938e4c8e45b547f22 25-Jul-2011 JP Abgrall <jpa@google.com> Merge "netd: bandwidthcontroler: add support for alerts via iptables' quota2 log messages"
d2d157cae8d9bcf0e4f20e3624597c752e97c9bf 25-Jul-2011 Dmitry Shmidt <dimitrysh@google.com> Merge "softap: Add P2P option to fwreload command"
54cf7fda69c3c442e7d2ac370a9c942fdb38dcd7 25-Jul-2011 Dmitry Shmidt <dimitrysh@google.com> softap: Add P2P option to fwreload command

Change-Id: I6fced56a6baa71a1d1fefe35832a43879ed12501
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
78dcb76aff7d3b9458374832a79688d36901127f 23-Jul-2011 Irfan Sheriff <isheriff@google.com> Add config update support for hostapd

Additional fixes:

Fix putting hostapd in daemon mode which results in init taking it over
and failure to stop

Also fix security check

Bug: 5069108
Change-Id: Ie0e2f975516975d270e48c9081480d85e201251f
oftapController.cpp
oftapController.h
8ab120320313522050a34f45982942c08880350a 22-Jul-2011 Dmitry Shmidt <dimitrysh@google.com> Merge "softap: Add hostapd support if BOARD_HOSTAPD_DRIVER is set"
e0ebc46c0aa38ce4f35bd3b60c0fcb9204d4c35e 22-Jul-2011 JP Abgrall <jpa@google.com> netd: NetlinkManager: add support receiving quota2 log messages

NetlinkManager, NetlinkHandler
. added support for netlink's NETLINK_NFLOG family used by the updated xt_quota2.
. it pushes the event all the wait to NetworkManagementService.java
"linit alert <alert_name> <iface_name>"

This needs:
- new kernel with quota2 changes that support logging via NETLINK's
NETLINK_NFLOG family.
- BandwidthController changes that setup the alerts.
- system core NetlinkEvent that recognizes the NFLOG messages.
- java land NetworkManagementService changes.

Change-Id: Id5b1026c6002803b5a1c0c7623cf7b1961de9802
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.cpp
etlinkManager.h
esponseCode.h
389f8d1550880f3bc67ade3e93f2ddb767e64092 22-Jul-2011 Dmitry Shmidt <dimitrysh@google.com> softap: Add hostapd support if BOARD_HOSTAPD_DRIVER is set

Change-Id: Ic1d8e46edc351f8dd36f30abe957d536cf491164
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ndroid.mk
oftapController.cpp
8a93272255f1b7e3083a97e1e28ddf675c0c7fb0 14-Jul-2011 JP Abgrall <jpa@google.com> netd: bandwidthcontroler: add support for alerts via iptables' quota2 log messages

* Fix quota2 updating. The old insert-new/delete-old scheme doesn't work as the kernel
keeps the old counter assigned to the new rule.

* Add support for setting dummy quotas used only for alerts.

This needs:
- new kernel with quota2 changes that support logging via NETLINK's
NETLINK_NFLOG family.
- NetlinkManager support for receiving the events.
- java land handler for these new events.

* new commands
- add/remove a dummy quota to generate an alert after <bytes> are seen including loopback.
alerts are only triggered once.
. ndc bandwidth setglobalalert <bytes>
calling it multiple times, just re-arms the alert for the specified number of bytes.
Use "ndc bandwidth getiquota singleAlert" to get what is left.
. ndc bandwidth removeglobalalert
- add/remove alert on a shared quota (similar accounting as shared quota)
. ndc bandwidth setsharedalert <bytes>
Requires that a shared quota already exist.
. ndc bandwidth removesharedalert
Removing the last of the shared quotas will remove the matching alert.
- add/remove alert on an interface (similar accounting as interface quota)
. ndc bandwidth setinterfacealert <iface> <bytes>
Requires that a interface quota already exist.
. ndc bandwidth removeinterfacealert <iface>
Removing the interface quota will remove the matching alert.
- get the quotas and alert leftovers
. ndc bandwidth getquota
shared quota leftover
. ndc bandwidth getiquota <quota_name_or_iface>
iface specific quota leftover
Can be used to read-out alerts. E.g.
setglobalalert 12345 -> getiquota globalAlert
setsharedalert 12345 -> getiquota sharedAlert
setinterfacealert iface0 12345 -> getiquota iface0Alert

Change-Id: Iea9698b9d20e713281755dac32b4772a6cf0e84e
andwidthController.cpp
andwidthController.h
ommandListener.cpp
esponseCode.h
bfa7466b328101a8b04807f26e85c84526c9a774 30-Jun-2011 JP Abgrall <jpa@google.com> netd: bandwidthcontroller: use named quotas (via quota2)

Replace using the "quota" with "quota2".
Quota2 is SMP-safe, and allows sharing a quota between protocols.

Bug: 4646092
Change-Id: I69b1dd6d2c5c3b39cf0df175369ae5a28843d489
Signed-off-by: JP Abgrall <jpa@google.com>
andwidthController.cpp
fe15b63d9def3721bb0ee4d2fa36c6f4d0daf8aa 19-Jul-2011 Dmitry Shmidt <dimitrysh@google.com> Softap: Use wifi_get_fw_path() instead of predefined path

Change-Id: I75d01f2d5a07298e53638aea2431030ca07fd458
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ndroid.mk
oftapController.cpp
06e176e2a824c5f6515893d119dd10603f9fc40f 18-Jul-2011 The Android Open Source Project <initial-contribution@android.com> Reconcile with gingerbread-release

Change-Id: I7ecfd1052c530b417f300e91c7ee28d1920dce2b
9b2c66653577ebcd36076533c3a33e490a4bc55b 12-Jul-2011 Jeff Brown <jeffbrown@google.com> Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I1ef5377c66e08b450a4a40195b8fe29a8037a8be
ndroid.mk
4c2b66678b24ec6401e36b307db93df8c4022876 08-Jul-2011 android-merger <android-build@android.com> reset, and keep history
ffbf657f58a825b60cd98c05ff4d0e2706824f78 08-Jul-2011 The Android Open Source Project <initial-contribution@android.com> Reconcile with gingerbread-release

Change-Id: I5a9cde4afd6b2bc4a02eda27c9d919ebfd322d1d
d77a0c71b123c9971b6f4c9394fad5a67a42984d 07-Jul-2011 android-merger <android-build@android.com> Revert "netd: Enable the SO_PASSCRED socket option"

This reverts commit 79b579c92afc08ab12c0a5788d61f2dd2934836f.
etlinkManager.cpp
39f8f24246a5dac21be5cc5e32c0f395ee803766 30-Jun-2011 JP Abgrall <jpa@google.com> bandwidthcontroller: brute-force cleanup to catch costly_<iface> chains.

To help with development, where re-enable is used as a cleanup mechanism
we no remove ALL user chains.
Normally we only expect
costly, penalty_box, and costly_<iface>.
If in the future we have more chains outside of those, this will need
revisiting.

Change-Id: I45e504bc1fe4ad973c00308967a474c73e959666
andwidthController.cpp
a9f802c23f4c2c53fa1065b75f712ce46f384c3a 30-Jun-2011 JP Abgrall <jpa@google.com> netd: bandwidthcontroller: fix removeiquota. remove excessive LOGD.

When doing
ndc bandwidth setiquota rmnet0 1235
ndc bandwidth removeiquota rmnet0
the remove would not cleanup the costly_rmnet0 chain.

Bug: 4975613
Change-Id: Ie2a593de78613dcf6833165c45fef75adf57ee23
Signed-off-by: JP Abgrall <jpa@google.com>
andwidthController.cpp
79bad9b7a43bd31c8f76a3364e2c881adb7c0c8b 28-Jun-2011 Kazuhiro Ondo <kazuhiro.ondo@motorola.com> am a0eece26: am 6b858eb3: Keep IP forwarding enabled in tools mode.

* commit 'a0eece268a7dbd837f73c80ad97cbea81abebf11':
Keep IP forwarding enabled in tools mode.
a0eece268a7dbd837f73c80ad97cbea81abebf11 28-Jun-2011 Kazuhiro Ondo <kazuhiro.ondo@motorola.com> am 6b858eb3: Keep IP forwarding enabled in tools mode.

* commit '6b858eb3b9b94b19c5153311e10b6e832722fb8e':
Keep IP forwarding enabled in tools mode.
6b858eb3b9b94b19c5153311e10b6e832722fb8e 25-Jun-2011 Kazuhiro Ondo <kazuhiro.ondo@motorola.com> Keep IP forwarding enabled in tools mode.

Do not disable IP forwarding after Tethering session is over
in tools mode so that modem logging tools are functional across
tethering sessions.

Change-Id: Id6eb91ded458c57822e6a96006778e11f4038d52
etherController.cpp
3d4363b4d84f66bba8153a2ac4afeac7ed064b5c 27-Jun-2011 Robert Greenwalt <rgreenwalt@google.com> Merge "resolved conflicts for merge of 80adaddf to master"
3c8cc74f81d0f81204bd827076889bb51143dff8 27-Jun-2011 Robert Greenwalt <rgreenwalt@google.com> resolved conflicts for merge of 80adaddf to master

Change-Id: I53c036b229352430c3faf57ce1d02fa889827690
40cd7e0fdbbc7463b6fb367c0d9bf95dec82a13e 27-Jun-2011 Mike J. Chen <mjchen@google.com> Merge changes Ie9674ca0,I8c0625a9

* changes:
Change string notification for link state change.
Revert "Revert "Add NETLINK_ROUTE socket creation and event propagation""
26e0d49fa743d7881104196a9eda733bd2aac92f 25-Jun-2011 JP Abgrall <jpa@google.com> netd: bandwidthcontroller: cleanup bool usage for readability.

replace stuff like:
f(buff, true, false) -> f(buff, ActionA, CaseD)

Change-Id: I8ff1d84f077d8f57263ecb7937b3f2caca86284b
andwidthController.cpp
andwidthController.h
0dad7c2f1f6994fbe5e85b9e1fc72d29d6453211 24-Jun-2011 JP Abgrall <jpa@google.com> BandwidthController: cleanup ipv4/v6, set/remove multiple quotas.

Regroup the ipv4/ipv6 choice deeper down to avoid copypasted code.
Shared quota accross ifaces.
Single quota per ifaces.

Nothing preventing an iface from have a single and shared quota.
Might be close to having a working combination.

Added commands:
- shared quota
ndc bandwidth setquotas <quotaBytes> <iface> ...
ndc bandwidth setquota <iface> <quotaBytes>
ndc bandwidth removequota <iface>
ndc bandwidth removequotas <iface> ...

- quota per iface
ndc bandwidth setiquota <iface> <quotaBytes>
ndc bandwidth removeiquota <iface>

Change-Id: I370d223da3c8b6e16e8d0a455309ae9e0756a721
andwidthController.cpp
andwidthController.h
ommandListener.cpp
a583f8be6126d3116311e96c6fd8bafcbaf2b431 24-Jun-2011 Mike J. Chen <mjchen@google.com> Change string notification for link state change.

Changed from linkstatus to linkstate to be more like the
notification function name.

Change-Id: Ie9674ca04bf9a9bdff2583786c301452d02b19fc
Signed-off-by: Mike J. Chen <mjchen@google.com>
etlinkHandler.cpp
564df4efc87f3d04c3570836d38134fd949c4caf 24-Jun-2011 Mike J. Chen <mjchen@google.com> Revert "Revert "Add NETLINK_ROUTE socket creation and event propagation""

This reverts commit 19fb0c4e5ec6a10473666a2d45267fbc8305ba85.

Conflicts:

NetlinkManager.cpp

Brings back Stan Chesnutt's change related to adding NETLINK_ROUTE
socket creation and event propagation.

Change-Id: I8c0625a95b7996ef75b883ce764c3244dd553a47
Signed-off-by: Mike J. Chen <mjchen@google.com>
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.cpp
etlinkManager.h
fa6f46d3370ae5475fc3bc8273bbe04ee7348d60 18-Jun-2011 JP Abgrall <jpa@google.com> netd:bandwidth: initial pass at app-rules, and some ipv6.

Adds initial per-app penalty box rules, and prepares for
handling per iface quota.

The following commands work:

* penalty box

ndc bandwidth addnaughtyapps <uid> ...
ndc bandwidth removenaughtyapps <uid> ...

* Shared quota

- add (updates the bytes, if they differ from last time)

ndc bandwidth setquota <iface> <bytes>
ndc bandwidth setquota <iface1> <bytes>
ndc bandwidth setquota <iface2> <bytes>

- remove
ndc bandwidth removequota <iface>
[ oldschool: ndc bandwidth setquota <iface> -1 ]

Change-Id: Ibefc16e81c7713feb47577a9687dcd032dedf06e
andwidthController.cpp
andwidthController.h
ommandListener.cpp
2ad297402daa97238e3fb099fe547e2c0b2cdc4b 23-Jun-2011 JP Abgrall <jpa@google.com> NatController: remove flushing the INPUT/OUTPUT tables.

It doesn't use them, so it should not have to flush them.
This is a minimalistic attempt to cooperate with the BandwidthController.

Change-Id: Ia175a86403adf034ac6f44d7ebc4ebe941881368
atController.cpp
80adaddfe0a997d7c9f45fafbd6f8b05e14d119c 23-Jun-2011 Robert Greenwalt <rgreenwalt@google.com> am d41806cb: Merge "Add ResolverController class"

* commit 'd41806cb55874d0eaf82fe11ffc62cf50a227313':
Add ResolverController class
d41806cb55874d0eaf82fe11ffc62cf50a227313 23-Jun-2011 Robert Greenwalt <rgreenwalt@google.com> Merge "Add ResolverController class"
786d1122d6a0a7b4bf16fdafe3b710759acc5094 31-May-2011 Mike Lockwood <lockwood@android.com> Remove obsolete support for controlling RNDIS USB networking

Change-Id: I1a49dc2c96998e9a44729b4b0303dbe9eb8c6569
Signed-off-by: Mike Lockwood <lockwood@android.com>
ndroid.mk
ommandListener.cpp
ommandListener.h
sbController.cpp
sbController.h
e734edd35d8d02da96330d77420650c044a12527 16-Jun-2011 Irfan Sheriff <isheriff@google.com> Add netd command to clean up IP addresses

Bug: 4676254
Change-Id: Ifb0b573750504f5daeb8db038d13dddd553797de
ommandListener.cpp
4a5f5ca3c9e07fc3e6feca2afde07f41a8a64f11 16-Jun-2011 JP Abgrall <jpa@google.com> system/netd: bandwidth management initial support (uid+tag stats)

This is a minimalistic version to get accounting of data going
through tagged socket per uid.

When netd starts up the BandwidthController, it will look at the
properties for
persist.bandwidth.enable=1
and enabled it.

It needs the kernel with the xt_qtaguid + iptables/netfilter goodness.
stlport is ok to use.

The "owner" netfilter module used is actually our xt_qtaguid that acts as it
(just until we get around to talking directly the to kernel).

Once
"ndc bandwidth enable"
is invoked all traffic is counted against the UIDs receiving/sending it.
This allows BlockGuard.java to "tag" sockets and see stats for the tags.

Data shows up in
/proc/net/xt_qtaguid/stats

/proc/net/xt_qtaguid/iface_stat/<iface>/
rx_packets_tcp
rx_bytes_tcp
...
There is no <uid>/...

Supported commands:
- "ndc bandwidth enable"
will setup the needed iptable entries to track tag/uid.
- "ndc bandwidth disable"
will remove the iptable entries.
- "ndc bandwidth setquota <iface> <value>"
will set a quota on the iface.
Once quota is reached, packets are rejected.
With the correct kernel, rejects are turned in socket errors.

TODO
----
* make bandwidth controller cooperate with tethering.
- they both manipulate the iptables.

Change-Id: Ieb9e7c60ef8c974e99828f7833065d59b2922bf3
ndroid.mk
andwidthController.cpp
andwidthController.h
ommandListener.cpp
ommandListener.h
4d0342ec22cc5ef0edc27033e2dcdacbb31d47f3 03-Jun-2011 John Michelau <john.michelau@motorola.com> am 0b0383be: am ac208608: Do not wipe all netd iptables rules in test mode

* commit '0b0383befa6843ad32c3ff30da3e91a0c0a8f9c7':
Do not wipe all netd iptables rules in test mode
0b0383befa6843ad32c3ff30da3e91a0c0a8f9c7 28-May-2011 John Michelau <john.michelau@motorola.com> am ac208608: Do not wipe all netd iptables rules in test mode

* commit 'ac208608c9e10ef199fdd11c38a31675ee9290c0':
Do not wipe all netd iptables rules in test mode
ac208608c9e10ef199fdd11c38a31675ee9290c0 28-May-2011 John Michelau <john.michelau@motorola.com> Do not wipe all netd iptables rules in test mode

The NatController fail-safe which flushes the iptables when the ref
count reaches zero unintentionally wipes out all static rules setup
by init in bp-tools test mode. Doing this flush is not necessary.

Change-Id: I37890e79cd701aa2e970958a246dfe7514a65c47
atController.cpp
f65f16552da0a10cc01e99b85b73d3f07188336f 20-May-2011 The Android Open Source Project <initial-contribution@android.com> Reconcile with gingerbread-release

Change-Id: Ibac35b4865cd0c39eff053ad84bddab50a2d6d6e
2beda2d6ec8a5b36a1d36a104521b95845a3a955 19-May-2011 Robert Greenwalt <rgreenwalt@google.com> am 442017ef: am e019b659: Add v4/v6 route add/remove to netd.

* commit '442017eff8f783a2ea86d73c2ee9d88aef175327':
Add v4/v6 route add/remove to netd.
442017eff8f783a2ea86d73c2ee9d88aef175327 19-May-2011 Robert Greenwalt <rgreenwalt@google.com> am e019b659: Add v4/v6 route add/remove to netd.

* commit 'e019b65925217bcc3ad9b662aa3125f0593057af':
Add v4/v6 route add/remove to netd.
4415a6992691845c86bbb7b8ac9bd4c620338daa 13-May-2011 The Android Automerger <android-build@android.com> merge in gingerbread-release history after reset to gingerbread
e019b65925217bcc3ad9b662aa3125f0593057af 10-May-2011 Robert Greenwalt <rgreenwalt@google.com> Add v4/v6 route add/remove to netd.

Now we can move this out of the framework.
Also adds v6 support and explicit route removal (rather than the big hammer of "remove all").

Change-Id: Ia7f1b12b2175c566c4906064796131a2f7e81466
ommandListener.cpp
111b24e1c64747b70e59bc4cc02fac81b11b7812 04-May-2011 Brian Carlstrom <bdc@google.com> am 38bfbace: resolved conflicts for merge of d1aed628 to honeycomb-plus-aosp

* commit '38bfbace16fa8dc7e69761e1f29586d0ef5ea90c':
DNS Proxy should not hang on addresses containing null bytes
38bfbace16fa8dc7e69761e1f29586d0ef5ea90c 04-May-2011 Brian Carlstrom <bdc@google.com> resolved conflicts for merge of d1aed628 to honeycomb-plus-aosp

Change-Id: I6a1ffad61d29c6d361272bdd55522f4bd5f0e2c5
d1aed628997033076580580db381eaee0a3d29df 03-May-2011 Brian Carlstrom <bdc@google.com> Merge "DNS Proxy should not hang on addresses containing null bytes"
dfc668ef05df9bb150c25590a1afb17fc3101e60 02-May-2011 Brian Carlstrom <bdc@google.com> am 1eef3e2f: (-s ours) am 1871a4f2: DNS Proxy should not hang on addresses containing null bytes DO NOT MERGE

* commit '1eef3e2f220e264984e1c9a94f3782a1350a3ff9':
DNS Proxy should not hang on addresses containing null bytes DO NOT MERGE
1eef3e2f220e264984e1c9a94f3782a1350a3ff9 30-Apr-2011 Brian Carlstrom <bdc@google.com> am 1871a4f2: DNS Proxy should not hang on addresses containing null bytes DO NOT MERGE

* commit '1871a4f2b20f5d2e52d67b6d91da4f8734455cd6':
DNS Proxy should not hang on addresses containing null bytes DO NOT MERGE
5c6d6af88f9db03493ef9926e0ceab30c8b132c9 30-Apr-2011 Brian Carlstrom <bdc@google.com> DNS Proxy should not hang on addresses containing null bytes

Two bugs here:

1.) The gethostbyaddr netd protocol was passing a binary address value
but the arguments are expected to be strings not containing
embedded nulls (or probably other special characters). This
happened reliably with IPv6 addresses which contained nulls. It
now expects an inet_ntop formatted address.

2.) Although the gethostbyaddr code detected something was wrong, it
wasn't doing any proper error handling, leaving clients hanging
waiting for a response. It now sends back an empty response so
that clients can continue.

A corresponding change will be necesssary in bionic for #1 for DNS
proxying to work, but given the fix for #2, the existing bionic code
will fall back to performing its own gethostbyaddr call.

Bug: 4344448
Change-Id: I2a55bb0cd0f1b0670f25c0c93554578bb20404e3
nsProxyListener.cpp
nsProxyListener.h
1871a4f2b20f5d2e52d67b6d91da4f8734455cd6 27-Apr-2011 Brian Carlstrom <bdc@google.com> DNS Proxy should not hang on addresses containing null bytes DO NOT MERGE

Two bugs here:

1.) The gethostbyaddr netd protocol was passing a binary address value
but the arguments are expected to be strings not containing
embedded nulls (or probably other special characters). This
happened reliably with IPv6 addresses which contained nulls. It
now expects an inet_ntop formatted address.

2.) Although the gethostbyaddr code detected something was wrong, it
wasn't doing any proper error handling, leaving clients hanging
waiting for a response. It now sends back an empty response so
that clients can continue.

A corresponding change will be necesssary in bionic for #1 for DNS
proxying to work, but given the fix for #2, the existing bionic code
will fall back to performing its own gethostbyaddr call.

Bug: 4344448
git cherry-pick -e 0475ae98cd8f45de815d67d1966edaf5997be9a9

Change-Id: I0b131032e06c16950b4e6810155529b57814c565
nsProxyListener.cpp
nsProxyListener.h
89c1e975f0c03997808d35c7be10b244c5309f9f 29-Apr-2011 Mattias Falk <mattias.falk@sonyericsson.com> Add ResolverController class

Added a ResolverController class that handles
the communication with the dns resolver in
netd.

Change-Id: I0f71bd516109fd942e68b3400666c7a859228372
ndroid.mk
ommandListener.cpp
ommandListener.h
esolverController.cpp
esolverController.h
0475ae98cd8f45de815d67d1966edaf5997be9a9 27-Apr-2011 Brian Carlstrom <bdc@google.com> DNS Proxy should not hang on addresses containing null bytes

Two bugs here:

1.) The gethostbyaddr netd protocol was passing a binary address value
but the arguments are expected to be strings not containing
embedded nulls (or probably other special characters). This
happened reliably with IPv6 addresses which contained nulls. It
now expects an inet_ntop formatted address.

2.) Although the gethostbyaddr code detected something was wrong, it
wasn't doing any proper error handling, leaving clients hanging
waiting for a response. It now sends back an empty response so
that clients can continue.

A corresponding change will be necesssary in bionic for #1 for DNS
proxying to work, but given the fix for #2, the existing bionic code
will fall back to performing its own gethostbyaddr call.

Bug: 4344448
Change-Id: I2d03bfec0093c67e8052717c0f499f8871bcfb85
nsProxyListener.cpp
nsProxyListener.h
14998b1aca89bb75f9e3d3bf080610a9cddce2dd 27-Apr-2011 Conley Owens <cco3@android.com> am 3a74e2f6: am c7d5ce4a: Ignore change "Set SO_PASSCRED on the uevent socket." in favor of change in internal change.

* commit '3a74e2f631209cf96c90b56e95c86d2bde1bb29e':
Set SO_PASSCRED on the uevent socket. (needed for change I393c21da)
3a74e2f631209cf96c90b56e95c86d2bde1bb29e 27-Apr-2011 Conley Owens <cco3@android.com> am c7d5ce4a: Ignore change "Set SO_PASSCRED on the uevent socket." in favor of change in internal change.

* commit 'c7d5ce4af83acc83c4d871ee57d118d7d9a81188':
Set SO_PASSCRED on the uevent socket. (needed for change I393c21da)
c7d5ce4af83acc83c4d871ee57d118d7d9a81188 27-Apr-2011 Conley Owens <cco3@android.com> Ignore change "Set SO_PASSCRED on the uevent socket." in favor of change
in internal change.

Change-Id: I9f78c5e0e7c3cb4714ce8f908d1478dadf027d97
93e79f10ff54f713106a7ae3ebc0baebba7c4de0 26-Apr-2011 Conley Owens <cco3@android.com> Merge "Set SO_PASSCRED on the uevent socket. (needed for change I393c21da)"
e6ab884a82964831ec075fa48d6935cc847e31b6 25-Apr-2011 Vernon Tang <vt@foilhead.net> Set SO_PASSCRED on the uevent socket. (needed for change I393c21da)

Change-Id: I11767da938f6e8fd9b3b604218c26c3c8b8da881
etlinkManager.cpp
8cd1bc2c5f2033e29d036210dfe5cb07666d0850 20-Apr-2011 Nick Kralevich <nnk@google.com> am adb408dc: am d5b10d36: netd: Enable the SO_PASSCRED socket option

* commit 'adb408dc79639b5377c58d306484bc388062d195':
netd: Enable the SO_PASSCRED socket option
adb408dc79639b5377c58d306484bc388062d195 20-Apr-2011 Nick Kralevich <nnk@google.com> am d5b10d36: netd: Enable the SO_PASSCRED socket option

* commit 'd5b10d3633c6717b46763edf1a50d3e29a007592':
netd: Enable the SO_PASSCRED socket option
d5b10d3633c6717b46763edf1a50d3e29a007592 19-Apr-2011 Nick Kralevich <nnk@google.com> netd: Enable the SO_PASSCRED socket option

Ensure that sender credentials are available when we
receive a netlink message.

This is a manual cherry-pick of
79b579c92afc08ab12c0a5788d61f2dd2934836f

Change-Id: Ia7e742c2ab2fd4149454364a8c20ab0b719196b4
etlinkManager.cpp
9642e016605c1faaf711bc80bb25f197ec270ff9 19-Apr-2011 Nick Kralevich <nnk@google.com> am ea52906e: am 97f5eec2: am 79b579c9: netd: Enable the SO_PASSCRED socket option

* commit 'ea52906efcdcead1b2c7a12e0d5fa16374c9892c':
netd: Enable the SO_PASSCRED socket option
ea52906efcdcead1b2c7a12e0d5fa16374c9892c 19-Apr-2011 Nick Kralevich <nnk@google.com> am 97f5eec2: am 79b579c9: netd: Enable the SO_PASSCRED socket option

* commit '97f5eec2ac9e78b8388be52be1ea95b4462537ee':
netd: Enable the SO_PASSCRED socket option
951528ad605f9d398f7e061241f45f7a3618d764 19-Apr-2011 Nick Kralevich <nnk@google.com> netd: Enable the SO_PASSCRED socket option

Ensure that sender credentials are available when we
receive a netlink message.

Change-Id: I8a352573c7e49d99b4f2fdb2e4ce9abe58d4fc49
etlinkManager.cpp
97f5eec2ac9e78b8388be52be1ea95b4462537ee 19-Apr-2011 Nick Kralevich <nnk@google.com> am 79b579c9: netd: Enable the SO_PASSCRED socket option

* commit '79b579c92afc08ab12c0a5788d61f2dd2934836f':
netd: Enable the SO_PASSCRED socket option
79b579c92afc08ab12c0a5788d61f2dd2934836f 19-Apr-2011 Nick Kralevich <nnk@google.com> netd: Enable the SO_PASSCRED socket option

Ensure that sender credentials are available when we
receive a netlink message.

Change-Id: I8a352573c7e49d99b4f2fdb2e4ce9abe58d4fc49
etlinkManager.cpp
34ffd85aed3838d53bd1136c751a7825de1940e0 17-Mar-2011 Brad Fitzpatrick <bradfitz@android.com> Reference count SocketClients.

Avoids a netd crash when the client closes its connection while
a DNS request is in-flight.

Depends on Icd7f5f03 in system/core.

Bug: 3438459
Change-Id: Ie6953196623b97ad2b90df951186fbfce84f8e4e
nsProxyListener.cpp
nsProxyListener.h
666fe255fa581965d2835bd581cd5a8959411067 08-Mar-2011 Dmitry Shmidt <dimitrysh@google.com> Softap: Add 'clients' command

Change-Id: I3694a0b2b570e0925b7f807f133e6fa5d95c3ac2
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ommandListener.cpp
oftapController.cpp
oftapController.h
a0c7ed2750c24550b086dfdebaf34f8fd45581c9 23-Feb-2011 David Turner <digit@android.com> am 0a60eb99: am 54a9575b: Merge "Add GetHostByAddrHandler to DnsProxyListener"

* commit '0a60eb99298e54a3fca719f6695b1d7347dc849a':
Add GetHostByAddrHandler to DnsProxyListener
0a60eb99298e54a3fca719f6695b1d7347dc849a 22-Feb-2011 David Turner <digit@android.com> am 54a9575b: Merge "Add GetHostByAddrHandler to DnsProxyListener"

* commit '54a9575bb7a83ef859ebf4fa2cd610e65b6e9db2':
Add GetHostByAddrHandler to DnsProxyListener
54a9575bb7a83ef859ebf4fa2cd610e65b6e9db2 17-Feb-2011 David Turner <digit@android.com> Merge "Add GetHostByAddrHandler to DnsProxyListener"
1dbd6cf148ea3fab57ec0644c336e94c78a488be 15-Feb-2011 Mattias Falk <mattias.falk@sonyericsson.com> Add GetHostByAddrHandler to DnsProxyListener

Added functionality to handle gethostbyaddr
in DnsProxyListener. The functionality is
used by getnameinfo. The patch is part of the
work to have one dns cache for all process in
the system.

Change-Id: Ia7609160d2bd1d3bbe2b79956bd208d137a8a9ee
nsProxyListener.cpp
nsProxyListener.h
1d93e170f13b221362ee268fdc94b25db06c21c9 01-Feb-2011 Robert Greenwalt <rgreenwalt@google.com> Stop using netmask in the framework.

Use prefixlength instead.
bug:2542681

Change-Id: I4cc0d9a84a5b043da7f8cb19a42cc6aaae3f9584
ommandListener.cpp
5c140d71edf861f8c6c47dc9a18c3b54aac7dea1 26-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> am 0787d3c9: am 2446b68f: Merge "Fix the DNS proxy again, for reals."

* commit '0787d3c93bd52d8799bc1fbc4848e56d669337f7':
Fix the DNS proxy again, for reals.
d18375235c62480b70ec9f271c9ef93c2e2c6014 26-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> am 8cee7841: am 41efab55: Merge "Fix DNS proxy."

* commit '8cee7841d6aec9868dc94961e42277e332376f12':
Fix DNS proxy.
2c028218ea56c5fcf6f5afe34b01861be4006d71 26-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> am e2e04304: am b9cab4ff: (-s ours) Merge "DNS proxy thread in netd."

* commit 'e2e043049e6c820a3ba03f89737c083796e238dc':
DNS proxy thread in netd.
0787d3c93bd52d8799bc1fbc4848e56d669337f7 26-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> am 2446b68f: Merge "Fix the DNS proxy again, for reals."

* commit '2446b68f8c0d72972f8f6ec7fa972d05a29c9f02':
Fix the DNS proxy again, for reals.
8cee7841d6aec9868dc94961e42277e332376f12 26-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> am 41efab55: Merge "Fix DNS proxy."

* commit '41efab55c8ca0344d5d68d0a3ab5b1b43f905e3b':
Fix DNS proxy.
e2e043049e6c820a3ba03f89737c083796e238dc 26-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> am b9cab4ff: (-s ours) Merge "DNS proxy thread in netd."

* commit 'b9cab4ff6f6d6581574157662878d4c3fa28185e':
DNS proxy thread in netd.
2446b68f8c0d72972f8f6ec7fa972d05a29c9f02 26-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> Merge "Fix the DNS proxy again, for reals."
41efab55c8ca0344d5d68d0a3ab5b1b43f905e3b 26-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> Merge "Fix DNS proxy."
b9cab4ff6f6d6581574157662878d4c3fa28185e 26-Jan-2011 Brad Fitzpatrick <bradfitz@android.com> Merge "DNS proxy thread in netd."
19fb0c4e5ec6a10473666a2d45267fbc8305ba85 09-Jan-2011 Wink Saville <wink@google.com> Revert "Add NETLINK_ROUTE socket creation and event propagation"

This reverts commit f6a7ad814dca2f67907eaed2cc0609c684850969.
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.cpp
etlinkManager.h
df9a6a82700a14169cc9d0b74833f1e261b171c6 02-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Fix the DNS proxy again, for reals.

me == the suck this morning

Bug: 3157030
Change-Id: Ib87ed047cd6999ee3d29b392acc7a559d9bb7349
nsProxyListener.cpp
89b99f2375271f2020dbb41ae96afd8c17b8e11a 02-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Fix DNS proxy.

Don't assume writing 0 bytes to SocketClient will be successful. (as
implemented in libsysutils right now, it returns an error...)

Bug: 3157030
Change-Id: I2b2cb8700cbf69be6dffa2e51d1c876c40675b9b
nsProxyListener.cpp
4e248e5a7a542067fd3f0467680eef2f92b1e195 27-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> DNS proxy thread in netd.

New thread in the netd process which listens on the
/dev/socket/dnsproxyd socket (group owned by 'inet', so only useable
by apps with the INTERNET permission), and does getaddrinfo requests
for other processes, caching in one place, rather than per-app.

Still remaining: proper caching based on DNS-requested lengths, upping
the cache size, getnameinfo, stats, flush, etc, etc.

Change-Id: I1d65af7d87876e508c718656bd81217cd961e20a
ndroid.mk
nsProxyListener.cpp
nsProxyListener.h
ain.cpp
f6a7ad814dca2f67907eaed2cc0609c684850969 05-Jan-2011 Stan Chesnutt <chesnutt@google.com> Add NETLINK_ROUTE socket creation and event propagation

Change-Id: I8cc8788661640600bceadeba8169e239bba98dec
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.cpp
etlinkManager.h
ff2c0d8c13457e43f0d4bf06d3177271aac104c1 17-Nov-2010 Olivier Bailly <olivier@google.com> Add missing include headers for compilation on x86 targets.

Change-Id: I99f7b79bfb5b6305a0772f418a54ace50cac1bbe
ommandListener.cpp
nsProxyListener.cpp
atController.cpp
etlinkHandler.cpp
anController.cpp
ppController.cpp
oftapController.cpp
etherController.cpp
hrottleController.cpp
sbController.cpp
40d0a52a74e2e915f4b595ba6c7afaa7c8e9626d 04-Nov-2010 Jean-Baptiste Queru <jbq@google.com> am f444b341: Merge aaf2e765 from open-source master

* commit 'f444b341768afcdb3f0934c068f3ead6bafdab78':
Include <bluedroid/bluetooth.h> only if HAVE_BLUETOOTH is defined.
f444b341768afcdb3f0934c068f3ead6bafdab78 04-Nov-2010 Jean-Baptiste Queru <jbq@google.com> Merge aaf2e765 from open-source master

Change-Id: I523c3e7def1d8dc1c9fa9308143bee952e73eeb9
aaf2e7655bcc7374c3562d2daf76577d4c3ac54c 03-Nov-2010 Jean-Baptiste Queru <jbq@google.com> Merge "Include <bluedroid/bluetooth.h> only if HAVE_BLUETOOTH is defined."
6c798fbf4e89c4058f046a65ee4f9aa5647e43e1 02-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Fix the DNS proxy again, for reals.

me == the suck this morning

Bug: 3157030
Change-Id: Ib87ed047cd6999ee3d29b392acc7a559d9bb7349
nsProxyListener.cpp
e6a3a58d6aa4b551e38e1e19fdfea2c0d2841b85 02-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> Fix DNS proxy.

Don't assume writing 0 bytes to SocketClient will be successful. (as
implemented in libsysutils right now, it returns an error...)

Bug: 3157030
Change-Id: I2b2cb8700cbf69be6dffa2e51d1c876c40675b9b
nsProxyListener.cpp
007e987fee7e815e0c4bc820f434a632b7a69a9d 27-Oct-2010 Brad Fitzpatrick <bradfitz@android.com> DNS proxy thread in netd.

New thread in the netd process which listens on the
/dev/socket/dnsproxyd socket (group owned by 'inet', so only useable
by apps with the INTERNET permission), and does getaddrinfo requests
for other processes, caching in one place, rather than per-app.

Still remaining: proper caching based on DNS-requested lengths, upping
the cache size, getnameinfo, stats, flush, etc, etc.

Change-Id: I1d65af7d87876e508c718656bd81217cd961e20a
ndroid.mk
nsProxyListener.cpp
nsProxyListener.h
ain.cpp
b5ff9b277f256df84caf3d798ccc83b4740a1d31 13-Oct-2010 Paul Eastham <eastham@google.com> Remove STOPSHIP comment

Change-Id: I2d42d6ddb16f88929b5edeeeb653feca8348e804
atController.cpp
fbd11c41aeb535723b78a61087fb436e64891055 12-Oct-2010 jmzhu <jmzhu@marvell.com> netd: softap: Add sub-ioctl command support

Change-Id: Ieb344fbb8853019e92a7385f7a190aa7451102dc
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
oftapController.h
56b6d45ebd9a9ae52ec5b75e7096cb02a23af1be 23-Sep-2010 Dmitry Shmidt <dimitrysh@google.com> Merge "softap: Incapsulate command call"
6665fb2adf78beddde21f7f3088a695646ca8c57 23-Sep-2010 Dmitry Shmidt <dimitrysh@google.com> softap: Incapsulate command call

Change-Id: I9c123252b3b5fa8649876e7e9138927d25dd1812
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
oftapController.h
e7732280e7af281d35f90d7794a31a7f6e10f185 20-Sep-2010 Brad Fitzpatrick <bradfitz@android.com> Use ptsname_r instead of ptsname in logwrapper.

Also other misc suggestions and fixes from Markus' review.

Bug: 3017876
Change-Id: I503f0340c2d75afb6850e36c1586f7f495638036
ogwrapper.c
faabd3d839d1503aa4ed82442fbff29ba0c70897 20-Sep-2010 Brad Fitzpatrick <bradfitz@android.com> Re-sync netd and vold's logwrapper.c forks.

Change-Id: Ie7ad47f0e9bfb862b92cd34070b79b6003549a16
ogwrapper.c
7826bd095a7ecfd642524cfd93a39a52986b73fc 17-Aug-2010 Rene Bolldorf <xsecute@googlemail.com> Include <bluedroid/bluetooth.h> only if HAVE_BLUETOOTH is defined.

Change-Id: Ie679cf8b382c4d0abafc0f81ab28fa0762ff179c
anController.cpp
a783390cc37cc8321fe695ba95ffaa5b6a2ed05b 14-May-2010 Nick Kralevich <nnk@google.com> Get rid of warnings when compiled with -Wformat-security

Change-Id: Iaed2edb7b43da5cb5cdd0bf641e45480633301fd
ogwrapper.c
6a5a63bd690b25d9c0b590f19169d6d3060f2330 30-Apr-2010 San Mehat <san@google.com> Merge "netd: Switch throttling to use HTB instead of CBQ" into froyo
9d8d728596234e1e49cb1f8267b190bcc2d4b685 30-Apr-2010 San Mehat <san@google.com> netd: Switch throttling to use HTB instead of CBQ

Change-Id: I5247c9b5264db374442d19d903a250413057f19d
Signed-off-by: San Mehat <san@google.com>
hrottleController.cpp
37dc4a51774b9c8a95205cb825eae6753170a851 29-Apr-2010 Robert Greenwalt <robdroid@android.com> Fix fd leaks

When you open a file, you should remember to close it.
bug:2639464

Change-Id: I90d25dba2a262b620373270832eb3189616c720d
etherController.cpp
sbController.cpp
ogwrapper.c
7421ff5c5f96a04837352d69ab8b0749855b4446 23-Apr-2010 Dmitry Shmidt <dimitrysh@google.com> Merge "softap: Add delay after driver start, return 0 if softap was started" into froyo
a165913421c5bed00a1f0b8e79e35e55b82aebbe 23-Apr-2010 Dmitry Shmidt <dimitrysh@google.com> softap: Add delay after driver start, return 0 if softap was started

Change-Id: I3e155cc7c118c21d5e66163bd678104d812465de
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
oftapController.h
651417c7c8662572de761c3b9260b1241ff21a79 23-Apr-2010 Robert Greenwalt <robdroid@android.com> Fix the reading of /proc/net/dev

When the bytes received counter gets too big it changes format from
name: 10 ...
name: 100 ...
name:1000 ...

The last one means sscanf can't parse a string and a long seperately - you
just get a string. Fixed by detecting a char after ':', splitting the name
and reparsing the long.

bug:2612082
Change-Id: I84e41da1e38d24ea61f996ede9c87769abba5d22
ommandListener.cpp
31c61c80a013bd1a050f0f4103e13fba62bf1717 14-Apr-2010 Robert Greenwalt <robdroid@android.com> Don't make such noise when ppp0 is unavailable.

On sholes ppp0 comes and goes with wifi and net availability. We don't want our traffic
poller to have to care (and deal with race conditions) so just don't make so much noise
if we try to read the traffic data for a non-existing iface.

bug:2576057
Change-Id: I8c1d721e7afc288b08cffb79f8f52f6cab55c88b
ommandListener.cpp
7e1f476ce965d9bde6e834bbe862faef548b2abb 10-Apr-2010 San Mehat <san@google.com> netd: Add ingress throttling

Change-Id: Id86a0d0d0bdfa9bca36e7c7bce7e9290c8532082
Signed-off-by: San Mehat <san@google.com>
hrottleController.cpp
a1992c9ff3e0d180c1f3042658ab9671d61a2fb8 08-Apr-2010 San Mehat <san@google.com> netd: Plumb interface throttling

Change-Id: I9092a37b3d5f2bfa4f49ddc473d0a5490abaae8f
Signed-off-by: San Mehat <san@google.com>
ndroid.mk
ommandListener.cpp
hrottleController.cpp
hrottleController.h
ogwrapper.c
321efa7340e327b25b4ea4e49d86817070a301c9 03-Apr-2010 Robert Greenwalt <robdroid@android.com> Fix network byte-count reading.

Some networks iface names are too long to fit in a 6-char string.

bug:2561759
Change-Id: I571c9871db424d349bc47b4d15c6015a33be6f2a
ommandListener.cpp
8e46896b4c4be5deaef651a12b17314f63ae9070 01-Apr-2010 San Mehat <san@google.com> netd: Add skelaton support for throttling

Change-Id: I361f3c4ac30f7bb6efe4ed703405f0e843b075b4
Signed-off-by: San Mehat <san@google.com>
ommandListener.cpp
ommandListener.h
esponseCode.h
210b97745e14830cdb1f29ee1109e6e516f4e6f6 25-Mar-2010 Robert Greenwalt <robdroid@android.com> Fix bug in NATing code.

Silly errors in refcount logic did the wrong thing.

Change-Id: I2cfc208615258397501450717cfcb7eb0386c9d4
atController.cpp
3208ea0b6cce28e7aef8459d548fd86df329e34f 25-Mar-2010 Robert Greenwalt <robdroid@android.com> Add support for multiple dhcp ranges.

We need multiple dhcp ranges to support dhcp on different interfaces.

bug:2533491
Change-Id: I3b568e81c048c6aff1a752ac4a81669034104413
ommandListener.cpp
etherController.cpp
etherController.h
1caafe66a6b927fa5d8eb4c59ec9eb48b0b1b075 24-Mar-2010 Robert Greenwalt <robdroid@android.com> Make NATing add/remove iptable rules as needed

It was flushing on every unNAT, but really you want to remove just those rules. We'll
Flush when we get to 0 NATs.

bug: 2542176
Change-Id: Ia70580191b1aed754689864044de122234346011
atController.cpp
atController.h
3df450af1c2e35d854768a508b6905c6794f7a74 18-Mar-2010 Dmitry Shmidt <dimitrysh@google.com> softap: Add delay after startap, set and stopap calls

Change-Id: I9b34d610b3576764324efbf78bb55322d1067378
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
oftapController.h
a2d7e3e7d6e3f163f06e522378c6e2bd5cee28f8 15-Mar-2010 Kenny Root <kroot@google.com> netd: Use OpenSSL APIs for WPA-PSK calculation

Change-Id: Ibe2040a2ede58fcfad5b27cdb01a107fbf2c9f3d
ndroid.mk
oftapController.cpp
ha1.c
ha1.h
c3539e22bd7a59a12542b9ad961f7d7f0db9a8df 12-Mar-2010 Dmitry Shmidt <dimitrysh@google.com> netd: softap: Add softap start / stop driver commands

Change-Id: I2081e4943b6b93109288e8d764ce25a55f3b6198
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ommandListener.cpp
oftapController.cpp
oftapController.h
9178b7390f9927aed57ae4a2da5b48991ed2aeea 12-Mar-2010 Dmitry Shmidt <dimitrysh@google.com> netd: softap: Fix driver API for SoftAP

Change-Id: I5e17b2369d5ef34ea29b0c1b0df1d4977ff109ce
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
31fd6c5f3e9c39a13b028718dba5921a4300988c 12-Mar-2010 Dmitry Shmidt <dimitrysh@google.com> netd: softap: Add FW reload processing

Change-Id: I731c2e390187c0fa5f69779cd25d8f2388ee511e
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ndroid.mk
ommandListener.cpp
oftapController.cpp
oftapController.h
321f95a95cd41e0f58a72ca4f382d7e0a7f26d01 10-Mar-2010 Dmitry Shmidt <dimitrysh@google.com> netd: softap: Add passphrase to hex conversion

Change-Id: Ia9b141cb436336deec6d94af701e6d807baa2f99
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ndroid.mk
oftapController.cpp
ha1.c
ha1.h
7977d67059ef94eefa9b14038df156b416fef877 09-Mar-2010 Dmitry Shmidt <dimitrysh@google.com> netd: softap: Change "set" to use separate arguments

Change-Id: Id5f2adb41c671f2978fa3fe939b1a3b15a537165
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
oftapController.h
9da1a982e6c86fd8473138254aac73359a742bf5 09-Mar-2010 Jean-Baptiste Queru <jbq@google.com> Add an empty CleanSpec.mk

Change-Id: Ic22ebb3ef1b4f4a3b44fe1d7975bd851c1fc12bd
leanSpec.mk
c2f87fca30aedd08c468d6f25458769944697f10 04-Mar-2010 Irfan Sheriff <isheriff@google.com> Merge "softap: Add basic functionality directly through WEXT"
84c65a62fe7b053fed7f20274ca7379627a87b79 03-Mar-2010 Dmitry Shmidt <dimitrysh@google.com> softap: Add basic functionality directly through WEXT

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
oftapController.cpp
oftapController.h
f15891b981b9a0ee5ab6c095b9a300bf224f2032 03-Mar-2010 Mike Lockwood <lockwood@android.com> Fix typo in UsbController::isRNDISStarted()

Signed-off-by: Mike Lockwood <lockwood@android.com>
sbController.cpp
e7b9422f0dc7a18041536c63efe74c7095496258 18-Feb-2010 Robert Greenwalt <robdroid@android.com> Add enable/disable control of USB networking

Also fix some errors in the interface control code (if we pass out all flags like so:
[up broadcast multicast]
we should probably accept that back)
ommandListener.cpp
3e6ba3ce1abda6071d5b01f53ca6039bb7b5e2d3 18-Feb-2010 Robert Greenwalt <robdroid@android.com> Add enable/disable control of USB networking
ndroid.mk
ommandListener.cpp
ommandListener.h
sbController.cpp
sbController.h
dc22e651287f19675ec1b46a04b335c360ea74af 18-Feb-2010 Kenny Root <kroot@google.com> Merge "Check total string length of supplied DNS servers"
cf52faf90be32aab3d0c4736a95f26923227e475 18-Feb-2010 Kenny Root <kroot@google.com> Check total string length of supplied DNS servers

Make sure the number of DNS servers doesn't grow past what we were
planning on handling in our string buffer.

Change-Id: Ic2d60b0a4363c806d4c3a7dfafa62930c4f5ca1f
etherController.cpp
67c5753274ee828b56f96b5e9cdae64c8562ad52 18-Feb-2010 Robert Greenwalt <robdroid@android.com> Hook netlink interface notification up to fwk.

The java api was there to get callbacks but the middle piece was missing.
Also has one const defined for USB control that is part of a seperate change, but no harm.
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.cpp
esponseCode.h
5af38c360587ca2eef0badf6137ccf018f8cd4aa 10-Feb-2010 Dmitry Shmidt <dimitrysh@google.com> netd: Add Softap controller skeleton functions

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
ndroid.mk
ommandListener.cpp
ommandListener.h
esponseCode.h
oftapController.cpp
oftapController.h
73ea55b52895727635705f18629406c58ca2044c 05-Feb-2010 Robert Greenwalt <robdroid@android.com> Silence PPPDs noisy logs.
ppController.cpp
3c2e611a921029a81dd7ff9c6d505b0b5e740014 03-Feb-2010 San Mehat <san@google.com> netd: Don't print error on unknown Netlink event

Signed-off-by: San Mehat <san@google.com>
etlinkHandler.cpp
74d8fdd307275bfdf95dcf61d9e6366e87da24ec 01-Feb-2010 Robert Greenwalt <robdroid@android.com> Add specification of ms-dns arg to pppd.

This lets us tell the pc to use the tethered android as their dns server.

bug:2281900
ommandListener.cpp
ppController.cpp
ppController.h
f1c368a83b738658d27720898b433bbc010123ba 28-Jan-2010 San Mehat <san@google.com> netd: Remove sigchild handler and fix a bluetooth makefile bug

Signed-off-by: San Mehat <san@google.com>
ndroid.mk
ain.cpp
01fed783828b592cda3b774deea4099a9e690e3d 23-Jan-2010 San Mehat <san@google.com> netd: Rename InterfaceGetInfoResult

Signed-off-by: San Mehat <san@google.com>
ommandListener.cpp
esponseCode.h
5c1b8af16dbbc20c89aaca2f93e725e12b16d055 22-Jan-2010 San Mehat <san@google.com> netd: Add Flush out enumerating/configuring interfaces

Signed-off-by: San Mehat <san@google.com>
ndroid.mk
ommandListener.cpp
ommandListener.h
esponseCode.h
ain.cpp
0399710d9a7ee575104e7d76dc988afb7829ccb9 22-Jan-2010 San Mehat <san@google.com> netd: Don't break build if BT is not available for the target

Signed-off-by: San Mehat <san@google.com>
ndroid.mk
anController.cpp
1bdac9e98c1ef37ba568b6cf23bfbc09cfe6bf15 21-Jan-2010 San Mehat <san@google.com> netd: Add preliminary support for BT PAN

Signed-off-by: San Mehat <san@google.com>
ndroid.mk
ommandListener.cpp
ommandListener.h
anController.cpp
anController.h
esponseCode.h
1881762f345d011d079ee318d31f0a8d8ee5891e 21-Jan-2010 San Mehat <san@google.com> netd: Implement tty lists and tty validation

Signed-off-by: San Mehat <san@google.com>
ppController.cpp
ppController.h
18737845d3c6a60edd6f75ac441a1b3fed6d66a7 21-Jan-2010 San Mehat <san@google.com> netd: Wait when killing tethering services

Signed-off-by: San Mehat <san@google.com>
etherController.cpp
d5573d34c8fac49e16b20cf144486125bf940086 20-Jan-2010 San Mehat <san@google.com> netd: Add support for attaching/detaching PPP daemons

Signed-off-by: San Mehat <san@google.com>
ndroid.mk
ommandListener.cpp
ommandListener.h
ppController.cpp
ppController.h
esponseCode.h
9ff78fb7da7158f5bd7c86d89a842691820259cf 19-Jan-2010 San Mehat <san@google.com> netd: Add primitive NAT control

Update: Add stub function to validate interface existance

Signed-off-by: San Mehat <san@google.com>
ndroid.mk
ommandListener.cpp
ommandListener.h
atController.cpp
atController.h
9d10b341a0ba46f108cb96e46691197d778cbc06 18-Jan-2010 San Mehat <san@google.com> netd: Plumb in the tethering interfaces

Signed-off-by: San Mehat <san@google.com>
ndroid.mk
ommandListener.cpp
ommandListener.h
esponseCode.h
etherController.cpp
etherController.h
dc.c
d18304287dbabc7835be771400b85d4ae8b63de6 15-Jan-2010 San Mehat <san@google.com> netd: Initial skelaton for netd

Signed-off-by: San Mehat <san@google.com>
ndroid.mk
ommandListener.cpp
ommandListener.h
etdCommand.cpp
etdCommand.h
etlinkHandler.cpp
etlinkHandler.h
etlinkManager.cpp
etlinkManager.h
esponseCode.h
ogwrapper.c
ain.cpp
dc.c
b79aa7a157b6b35a5944649d769fc092e5f6561c 13-Jan-2010 Nico Sallembien <nsallembien@google.com> new project, first commit