OSDN Git Service

android-x86/system-netd.git
13 years agoam 59da4baf: (-s ours) am b725a59f: Merge "DO NOT MERGE: NatController: remove flushi...
JP Abgrall [Wed, 27 Jul 2011 01:37:02 +0000 (18:37 -0700)]
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.

13 years agoam 7d8c2811: am a45de8a8: Add dns proxy controls from opensource.
Robert Greenwalt [Wed, 27 Jul 2011 01:37:00 +0000 (18:37 -0700)]
am 7d8c2811: am a45de8a8: Add dns proxy controls from opensource.

* commit '7d8c2811e3604acfd6acfd2f7022919a633b394f':
  Add dns proxy controls from opensource.

13 years agoam b725a59f: Merge "DO NOT MERGE: NatController: remove flushing the INPUT/OUTPUT...
JP Abgrall [Wed, 27 Jul 2011 01:09:27 +0000 (18:09 -0700)]
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.

13 years agoMerge "DO NOT MERGE: NatController: remove flushing the INPUT/OUTPUT tables." into...
JP Abgrall [Wed, 27 Jul 2011 01:04:49 +0000 (18:04 -0700)]
Merge "DO NOT MERGE: NatController: remove flushing the INPUT/OUTPUT tables." into honeycomb-LTE

13 years agoam a45de8a8: Add dns proxy controls from opensource.
Robert Greenwalt [Tue, 26 Jul 2011 20:24:45 +0000 (13:24 -0700)]
am a45de8a8: Add dns proxy controls from opensource.

* commit 'a45de8a8d4def24fbcc21602400214b5ca7ffad1':
  Add dns proxy controls from opensource.

13 years agoDO NOT MERGE: NatController: remove flushing the INPUT/OUTPUT tables.
JP Abgrall [Thu, 23 Jun 2011 01:50:04 +0000 (18:50 -0700)]
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

13 years agoAdd dns proxy controls from opensource.
Robert Greenwalt [Mon, 25 Jul 2011 23:53:52 +0000 (16:53 -0700)]
Add dns proxy controls from opensource.

Port of change 22099 from the opensource.
bug:5060618

Change-Id: Ic99345881fcb30c6f1d5545a32401e6ada865d78

13 years agowifi: Ensure that entropy file exists
Dmitry Shmidt [Mon, 25 Jul 2011 17:51:56 +0000 (10:51 -0700)]
wifi: Ensure that entropy file exists

Change-Id: Ib5ea7a6767a4ab7c4244bfc27248ee04340018a7
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoMerge "netd: NetlinkManager: add support receiving quota2 log messages"
JP Abgrall [Mon, 25 Jul 2011 17:15:46 +0000 (10:15 -0700)]
Merge "netd: NetlinkManager: add support receiving quota2 log messages"

13 years agoMerge "netd: bandwidthcontroler: add support for alerts via iptables' quota2 log...
JP Abgrall [Mon, 25 Jul 2011 17:15:24 +0000 (10:15 -0700)]
Merge "netd: bandwidthcontroler: add support for alerts via iptables' quota2 log messages"

13 years agoMerge "softap: Add P2P option to fwreload command"
Dmitry Shmidt [Mon, 25 Jul 2011 00:13:17 +0000 (17:13 -0700)]
Merge "softap: Add P2P option to fwreload command"

13 years agosoftap: Add P2P option to fwreload command
Dmitry Shmidt [Sun, 24 Jul 2011 23:46:13 +0000 (16:46 -0700)]
softap: Add P2P option to fwreload command

Change-Id: I6fced56a6baa71a1d1fefe35832a43879ed12501
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoAdd config update support for hostapd
Irfan Sheriff [Fri, 22 Jul 2011 22:20:21 +0000 (15:20 -0700)]
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

13 years agoMerge "softap: Add hostapd support if BOARD_HOSTAPD_DRIVER is set"
Dmitry Shmidt [Fri, 22 Jul 2011 18:12:58 +0000 (11:12 -0700)]
Merge "softap: Add hostapd support if BOARD_HOSTAPD_DRIVER is set"

13 years agonetd: NetlinkManager: add support receiving quota2 log messages
JP Abgrall [Fri, 22 Jul 2011 00:21:49 +0000 (17:21 -0700)]
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

13 years agosoftap: Add hostapd support if BOARD_HOSTAPD_DRIVER is set
Dmitry Shmidt [Thu, 21 Jul 2011 22:16:04 +0000 (15:16 -0700)]
softap: Add hostapd support if BOARD_HOSTAPD_DRIVER is set

Change-Id: Ic1d8e46edc351f8dd36f30abe957d536cf491164
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agonetd: bandwidthcontroler: add support for alerts via iptables' quota2 log messages
JP Abgrall [Thu, 14 Jul 2011 02:17:35 +0000 (19:17 -0700)]
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

13 years agonetd: bandwidthcontroller: use named quotas (via quota2)
JP Abgrall [Thu, 30 Jun 2011 02:23:04 +0000 (19:23 -0700)]
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>
13 years agoSoftap: Use wifi_get_fw_path() instead of predefined path
Dmitry Shmidt [Tue, 19 Jul 2011 20:55:25 +0000 (13:55 -0700)]
Softap: Use wifi_get_fw_path() instead of predefined path

Change-Id: I75d01f2d5a07298e53638aea2431030ca07fd458
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoReconcile with gingerbread-release
The Android Open Source Project [Mon, 18 Jul 2011 15:10:22 +0000 (08:10 -0700)]
Reconcile with gingerbread-release

Change-Id: I7ecfd1052c530b417f300e91c7ee28d1920dce2b

13 years agoRemove the simulator target from all makefiles.
Jeff Brown [Tue, 12 Jul 2011 05:12:35 +0000 (22:12 -0700)]
Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I1ef5377c66e08b450a4a40195b8fe29a8037a8be

13 years agoreset, and keep history
android-merger [Fri, 8 Jul 2011 19:28:16 +0000 (12:28 -0700)]
reset, and keep history

13 years agoReconcile with gingerbread-release
The Android Open Source Project [Thu, 7 Jul 2011 22:22:41 +0000 (15:22 -0700)]
Reconcile with gingerbread-release

Change-Id: I5a9cde4afd6b2bc4a02eda27c9d919ebfd322d1d

13 years agoRevert "netd: Enable the SO_PASSCRED socket option"
android-merger [Thu, 7 Jul 2011 21:53:06 +0000 (14:53 -0700)]
Revert "netd: Enable the SO_PASSCRED socket option"

This reverts commit 79b579c92afc08ab12c0a5788d61f2dd2934836f.

13 years agobandwidthcontroller: brute-force cleanup to catch costly_<iface> chains.
JP Abgrall [Thu, 30 Jun 2011 02:21:58 +0000 (19:21 -0700)]
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

13 years agonetd: bandwidthcontroller: fix removeiquota. remove excessive LOGD.
JP Abgrall [Wed, 29 Jun 2011 22:46:45 +0000 (15:46 -0700)]
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>
13 years agoam a0eece26: am 6b858eb3: Keep IP forwarding enabled in tools mode.
Kazuhiro Ondo [Tue, 28 Jun 2011 00:59:20 +0000 (17:59 -0700)]
am a0eece26: am 6b858eb3: Keep IP forwarding enabled in tools mode.

* commit 'a0eece268a7dbd837f73c80ad97cbea81abebf11':
  Keep IP forwarding enabled in tools mode.

13 years agoam 6b858eb3: Keep IP forwarding enabled in tools mode.
Kazuhiro Ondo [Tue, 28 Jun 2011 00:58:23 +0000 (17:58 -0700)]
am 6b858eb3: Keep IP forwarding enabled in tools mode.

* commit '6b858eb3b9b94b19c5153311e10b6e832722fb8e':
  Keep IP forwarding enabled in tools mode.

13 years agoKeep IP forwarding enabled in tools mode.
Kazuhiro Ondo [Sat, 25 Jun 2011 01:31:03 +0000 (20:31 -0500)]
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

13 years agoMerge "resolved conflicts for merge of 80adaddf to master"
Robert Greenwalt [Mon, 27 Jun 2011 21:04:16 +0000 (14:04 -0700)]
Merge "resolved conflicts for merge of 80adaddf to master"

13 years agoresolved conflicts for merge of 80adaddf to master
Robert Greenwalt [Mon, 27 Jun 2011 21:02:54 +0000 (14:02 -0700)]
resolved conflicts for merge of 80adaddf to master

Change-Id: I53c036b229352430c3faf57ce1d02fa889827690

13 years agoMerge changes Ie9674ca0,I8c0625a9
Mike J. Chen [Mon, 27 Jun 2011 19:56:33 +0000 (12:56 -0700)]
Merge changes Ie9674ca0,I8c0625a9

* changes:
  Change string notification for link state change.
  Revert "Revert "Add NETLINK_ROUTE socket creation and event propagation""

13 years agonetd: bandwidthcontroller: cleanup bool usage for readability.
JP Abgrall [Sat, 25 Jun 2011 02:21:51 +0000 (19:21 -0700)]
netd: bandwidthcontroller: cleanup bool usage for readability.

replace stuff like:
   f(buff, true, false) -> f(buff, ActionA, CaseD)

Change-Id: I8ff1d84f077d8f57263ecb7937b3f2caca86284b

13 years agoBandwidthController: cleanup ipv4/v6, set/remove multiple quotas.
JP Abgrall [Fri, 24 Jun 2011 18:58:14 +0000 (11:58 -0700)]
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

13 years agoChange string notification for link state change.
Mike J. Chen [Thu, 23 Jun 2011 22:11:53 +0000 (15:11 -0700)]
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>
13 years agoRevert "Revert "Add NETLINK_ROUTE socket creation and event propagation""
Mike J. Chen [Thu, 23 Jun 2011 22:07:35 +0000 (15:07 -0700)]
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>
13 years agonetd:bandwidth: initial pass at app-rules, and some ipv6.
JP Abgrall [Sat, 18 Jun 2011 06:17:28 +0000 (23:17 -0700)]
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

13 years agoNatController: remove flushing the INPUT/OUTPUT tables.
JP Abgrall [Thu, 23 Jun 2011 01:50:04 +0000 (18:50 -0700)]
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

13 years agoam d41806cb: Merge "Add ResolverController class"
Robert Greenwalt [Thu, 23 Jun 2011 18:12:17 +0000 (11:12 -0700)]
am d41806cb: Merge "Add ResolverController class"

* commit 'd41806cb55874d0eaf82fe11ffc62cf50a227313':
  Add ResolverController class

13 years agoMerge "Add ResolverController class"
Robert Greenwalt [Thu, 23 Jun 2011 17:21:14 +0000 (10:21 -0700)]
Merge "Add ResolverController class"

13 years agoRemove obsolete support for controlling RNDIS USB networking
Mike Lockwood [Tue, 31 May 2011 17:43:17 +0000 (13:43 -0400)]
Remove obsolete support for controlling RNDIS USB networking

Change-Id: I1a49dc2c96998e9a44729b4b0303dbe9eb8c6569
Signed-off-by: Mike Lockwood <lockwood@android.com>
13 years agoAdd netd command to clean up IP addresses
Irfan Sheriff [Thu, 16 Jun 2011 17:28:47 +0000 (10:28 -0700)]
Add netd command to clean up IP addresses

Bug: 4676254
Change-Id: Ifb0b573750504f5daeb8db038d13dddd553797de

13 years agosystem/netd: bandwidth management initial support (uid+tag stats)
JP Abgrall [Thu, 16 Jun 2011 01:37:39 +0000 (18:37 -0700)]
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

13 years agoam 0b0383be: am ac208608: Do not wipe all netd iptables rules in test mode
John Michelau [Thu, 2 Jun 2011 23:51:56 +0000 (16:51 -0700)]
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

13 years agoam ac208608: Do not wipe all netd iptables rules in test mode
John Michelau [Sat, 28 May 2011 04:38:02 +0000 (21:38 -0700)]
am ac208608: Do not wipe all netd iptables rules in test mode

* commit 'ac208608c9e10ef199fdd11c38a31675ee9290c0':
  Do not wipe all netd iptables rules in test mode

13 years agoDo not wipe all netd iptables rules in test mode
John Michelau [Sat, 28 May 2011 03:07:20 +0000 (22:07 -0500)]
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

13 years agoReconcile with gingerbread-release
The Android Open Source Project [Fri, 20 May 2011 21:19:45 +0000 (14:19 -0700)]
Reconcile with gingerbread-release

Change-Id: Ibac35b4865cd0c39eff053ad84bddab50a2d6d6e

13 years agoam 442017ef: am e019b659: Add v4/v6 route add/remove to netd.
Robert Greenwalt [Thu, 19 May 2011 14:21:25 +0000 (07:21 -0700)]
am 442017ef: am e019b659: Add v4/v6 route add/remove to netd.

* commit '442017eff8f783a2ea86d73c2ee9d88aef175327':
  Add v4/v6 route add/remove to netd.

13 years agoam e019b659: Add v4/v6 route add/remove to netd.
Robert Greenwalt [Wed, 18 May 2011 23:30:12 +0000 (16:30 -0700)]
am e019b659: Add v4/v6 route add/remove to netd.

* commit 'e019b65925217bcc3ad9b662aa3125f0593057af':
  Add v4/v6 route add/remove to netd.

13 years agomerge in gingerbread-release history after reset to gingerbread
The Android Automerger [Fri, 13 May 2011 21:27:38 +0000 (14:27 -0700)]
merge in gingerbread-release history after reset to gingerbread

13 years agoAdd v4/v6 route add/remove to netd.
Robert Greenwalt [Tue, 10 May 2011 21:57:03 +0000 (14:57 -0700)]
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

13 years agoam 38bfbace: resolved conflicts for merge of d1aed628 to honeycomb-plus-aosp
Brian Carlstrom [Tue, 3 May 2011 23:11:54 +0000 (16:11 -0700)]
am 38bfbace: resolved conflicts for merge of d1aed628 to honeycomb-plus-aosp

* commit '38bfbace16fa8dc7e69761e1f29586d0ef5ea90c':
  DNS Proxy should not hang on addresses containing null bytes

13 years agoresolved conflicts for merge of d1aed628 to honeycomb-plus-aosp
Brian Carlstrom [Tue, 3 May 2011 22:11:19 +0000 (15:11 -0700)]
resolved conflicts for merge of d1aed628 to honeycomb-plus-aosp

Change-Id: I6a1ffad61d29c6d361272bdd55522f4bd5f0e2c5

13 years agoMerge "DNS Proxy should not hang on addresses containing null bytes"
Brian Carlstrom [Tue, 3 May 2011 17:21:33 +0000 (10:21 -0700)]
Merge "DNS Proxy should not hang on addresses containing null bytes"

13 years agoam 1eef3e2f: (-s ours) am 1871a4f2: DNS Proxy should not hang on addresses containing...
Brian Carlstrom [Mon, 2 May 2011 18:55:53 +0000 (11:55 -0700)]
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

13 years agoam 1871a4f2: DNS Proxy should not hang on addresses containing null bytes DO NOT...
Brian Carlstrom [Sat, 30 Apr 2011 03:49:44 +0000 (20:49 -0700)]
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

13 years agoDNS Proxy should not hang on addresses containing null bytes
Brian Carlstrom [Fri, 29 Apr 2011 23:49:41 +0000 (16:49 -0700)]
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

13 years agoDNS Proxy should not hang on addresses containing null bytes DO NOT MERGE
Brian Carlstrom [Wed, 27 Apr 2011 18:47:41 +0000 (11:47 -0700)]
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

13 years agoAdd ResolverController class
Mattias Falk [Fri, 29 Apr 2011 12:48:51 +0000 (14:48 +0200)]
Add ResolverController class

Added a ResolverController class that handles
the communication with the dns resolver in
netd.

Change-Id: I0f71bd516109fd942e68b3400666c7a859228372

13 years agoDNS Proxy should not hang on addresses containing null bytes
Brian Carlstrom [Wed, 27 Apr 2011 18:47:41 +0000 (11:47 -0700)]
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

13 years agoam 3a74e2f6: am c7d5ce4a: Ignore change "Set SO_PASSCRED on the uevent socket." in...
Conley Owens [Tue, 26 Apr 2011 23:04:01 +0000 (16:04 -0700)]
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)

13 years agoam c7d5ce4a: Ignore change "Set SO_PASSCRED on the uevent socket." in favor of change...
Conley Owens [Tue, 26 Apr 2011 22:59:10 +0000 (15:59 -0700)]
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)

13 years agoIgnore change "Set SO_PASSCRED on the uevent socket." in favor of change
Conley Owens [Tue, 26 Apr 2011 22:27:59 +0000 (15:27 -0700)]
Ignore change "Set SO_PASSCRED on the uevent socket." in favor of change
in internal change.

Change-Id: I9f78c5e0e7c3cb4714ce8f908d1478dadf027d97

13 years agoMerge "Set SO_PASSCRED on the uevent socket. (needed for change I393c21da)"
Conley Owens [Tue, 26 Apr 2011 19:51:02 +0000 (12:51 -0700)]
Merge "Set SO_PASSCRED on the uevent socket. (needed for change I393c21da)"

13 years agoSet SO_PASSCRED on the uevent socket. (needed for change I393c21da)
Vernon Tang [Mon, 25 Apr 2011 03:31:34 +0000 (13:31 +1000)]
Set SO_PASSCRED on the uevent socket. (needed for change I393c21da)

Change-Id: I11767da938f6e8fd9b3b604218c26c3c8b8da881

13 years agoam adb408dc: am d5b10d36: netd: Enable the SO_PASSCRED socket option
Nick Kralevich [Tue, 19 Apr 2011 22:47:13 +0000 (15:47 -0700)]
am adb408dc: am d5b10d36: netd: Enable the SO_PASSCRED socket option

* commit 'adb408dc79639b5377c58d306484bc388062d195':
  netd: Enable the SO_PASSCRED socket option

13 years agoam d5b10d36: netd: Enable the SO_PASSCRED socket option
Nick Kralevich [Tue, 19 Apr 2011 22:38:41 +0000 (15:38 -0700)]
am d5b10d36: netd: Enable the SO_PASSCRED socket option

* commit 'd5b10d3633c6717b46763edf1a50d3e29a007592':
  netd: Enable the SO_PASSCRED socket option

13 years agonetd: Enable the SO_PASSCRED socket option
Nick Kralevich [Mon, 18 Apr 2011 22:54:13 +0000 (15:54 -0700)]
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

13 years agoam ea52906e: am 97f5eec2: am 79b579c9: netd: Enable the SO_PASSCRED socket option
Nick Kralevich [Tue, 19 Apr 2011 17:38:24 +0000 (10:38 -0700)]
am ea52906e: am 97f5eec2: am 79b579c9: netd: Enable the SO_PASSCRED socket option

* commit 'ea52906efcdcead1b2c7a12e0d5fa16374c9892c':
  netd: Enable the SO_PASSCRED socket option

13 years agoam 97f5eec2: am 79b579c9: netd: Enable the SO_PASSCRED socket option
Nick Kralevich [Tue, 19 Apr 2011 17:26:04 +0000 (10:26 -0700)]
am 97f5eec2: am 79b579c9: netd: Enable the SO_PASSCRED socket option

* commit '97f5eec2ac9e78b8388be52be1ea95b4462537ee':
  netd: Enable the SO_PASSCRED socket option

13 years agonetd: Enable the SO_PASSCRED socket option
Nick Kralevich [Mon, 18 Apr 2011 22:54:13 +0000 (15:54 -0700)]
netd: Enable the SO_PASSCRED socket option

Ensure that sender credentials are available when we
receive a netlink message.

Change-Id: I8a352573c7e49d99b4f2fdb2e4ce9abe58d4fc49

13 years agoam 79b579c9: netd: Enable the SO_PASSCRED socket option
Nick Kralevich [Mon, 18 Apr 2011 23:31:23 +0000 (16:31 -0700)]
am 79b579c9: netd: Enable the SO_PASSCRED socket option

* commit '79b579c92afc08ab12c0a5788d61f2dd2934836f':
  netd: Enable the SO_PASSCRED socket option

13 years agonetd: Enable the SO_PASSCRED socket option
Nick Kralevich [Mon, 18 Apr 2011 22:54:13 +0000 (15:54 -0700)]
netd: Enable the SO_PASSCRED socket option

Ensure that sender credentials are available when we
receive a netlink message.

Change-Id: I8a352573c7e49d99b4f2fdb2e4ce9abe58d4fc49

13 years agoReference count SocketClients.
Brad Fitzpatrick [Thu, 17 Mar 2011 22:53:22 +0000 (15:53 -0700)]
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

13 years agoSoftap: Add 'clients' command
Dmitry Shmidt [Tue, 8 Mar 2011 19:01:58 +0000 (11:01 -0800)]
Softap: Add 'clients' command

Change-Id: I3694a0b2b570e0925b7f807f133e6fa5d95c3ac2
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
13 years agoam 0a60eb99: am 54a9575b: Merge "Add GetHostByAddrHandler to DnsProxyListener"
David Turner [Wed, 23 Feb 2011 05:36:22 +0000 (21:36 -0800)]
am 0a60eb99: am 54a9575b: Merge "Add GetHostByAddrHandler to DnsProxyListener"

* commit '0a60eb99298e54a3fca719f6695b1d7347dc849a':
  Add GetHostByAddrHandler to DnsProxyListener

13 years agoam 54a9575b: Merge "Add GetHostByAddrHandler to DnsProxyListener"
David Turner [Tue, 22 Feb 2011 22:47:33 +0000 (14:47 -0800)]
am 54a9575b: Merge "Add GetHostByAddrHandler to DnsProxyListener"

* commit '54a9575bb7a83ef859ebf4fa2cd610e65b6e9db2':
  Add GetHostByAddrHandler to DnsProxyListener

13 years agoMerge "Add GetHostByAddrHandler to DnsProxyListener"
David Turner [Thu, 17 Feb 2011 02:57:27 +0000 (18:57 -0800)]
Merge "Add GetHostByAddrHandler to DnsProxyListener"

13 years agoAdd GetHostByAddrHandler to DnsProxyListener
Mattias Falk [Tue, 15 Feb 2011 07:43:18 +0000 (08:43 +0100)]
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

13 years agoStop using netmask in the framework.
Robert Greenwalt [Tue, 1 Feb 2011 21:54:35 +0000 (13:54 -0800)]
Stop using netmask in the framework.

Use prefixlength instead.
bug:2542681

Change-Id: I4cc0d9a84a5b043da7f8cb19a42cc6aaae3f9584

13 years agoam 0787d3c9: am 2446b68f: Merge "Fix the DNS proxy again, for reals."
Brad Fitzpatrick [Wed, 26 Jan 2011 00:25:21 +0000 (16:25 -0800)]
am 0787d3c9: am 2446b68f: Merge "Fix the DNS proxy again, for reals."

* commit '0787d3c93bd52d8799bc1fbc4848e56d669337f7':
  Fix the DNS proxy again, for reals.

13 years agoam 8cee7841: am 41efab55: Merge "Fix DNS proxy."
Brad Fitzpatrick [Wed, 26 Jan 2011 00:25:20 +0000 (16:25 -0800)]
am 8cee7841: am 41efab55: Merge "Fix DNS proxy."

* commit '8cee7841d6aec9868dc94961e42277e332376f12':
  Fix DNS proxy.

13 years agoam e2e04304: am b9cab4ff: (-s ours) Merge "DNS proxy thread in netd."
Brad Fitzpatrick [Wed, 26 Jan 2011 00:25:18 +0000 (16:25 -0800)]
am e2e04304: am b9cab4ff: (-s ours) Merge "DNS proxy thread in netd."

* commit 'e2e043049e6c820a3ba03f89737c083796e238dc':
  DNS proxy thread in netd.

13 years agoam 2446b68f: Merge "Fix the DNS proxy again, for reals."
Brad Fitzpatrick [Wed, 26 Jan 2011 00:21:25 +0000 (16:21 -0800)]
am 2446b68f: Merge "Fix the DNS proxy again, for reals."

* commit '2446b68f8c0d72972f8f6ec7fa972d05a29c9f02':
  Fix the DNS proxy again, for reals.

13 years agoam 41efab55: Merge "Fix DNS proxy."
Brad Fitzpatrick [Wed, 26 Jan 2011 00:21:23 +0000 (16:21 -0800)]
am 41efab55: Merge "Fix DNS proxy."

* commit '41efab55c8ca0344d5d68d0a3ab5b1b43f905e3b':
  Fix DNS proxy.

13 years agoam b9cab4ff: (-s ours) Merge "DNS proxy thread in netd."
Brad Fitzpatrick [Wed, 26 Jan 2011 00:21:21 +0000 (16:21 -0800)]
am b9cab4ff: (-s ours) Merge "DNS proxy thread in netd."

* commit 'b9cab4ff6f6d6581574157662878d4c3fa28185e':
  DNS proxy thread in netd.

13 years agoMerge "Fix the DNS proxy again, for reals."
Brad Fitzpatrick [Tue, 25 Jan 2011 23:08:05 +0000 (15:08 -0800)]
Merge "Fix the DNS proxy again, for reals."

13 years agoMerge "Fix DNS proxy."
Brad Fitzpatrick [Tue, 25 Jan 2011 23:08:03 +0000 (15:08 -0800)]
Merge "Fix DNS proxy."

13 years agoMerge "DNS proxy thread in netd."
Brad Fitzpatrick [Tue, 25 Jan 2011 23:07:58 +0000 (15:07 -0800)]
Merge "DNS proxy thread in netd."

13 years agoRevert "Add NETLINK_ROUTE socket creation and event propagation"
Wink Saville [Sun, 9 Jan 2011 20:21:40 +0000 (12:21 -0800)]
Revert "Add NETLINK_ROUTE socket creation and event propagation"

This reverts commit f6a7ad814dca2f67907eaed2cc0609c684850969.

13 years agoFix the DNS proxy again, for reals.
Brad Fitzpatrick [Tue, 2 Nov 2010 18:48:20 +0000 (11:48 -0700)]
Fix the DNS proxy again, for reals.

me == the suck this morning

Bug: 3157030
Change-Id: Ib87ed047cd6999ee3d29b392acc7a559d9bb7349

13 years agoFix DNS proxy.
Brad Fitzpatrick [Tue, 2 Nov 2010 17:50:55 +0000 (10:50 -0700)]
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

13 years agoDNS proxy thread in netd.
Brad Fitzpatrick [Wed, 27 Oct 2010 18:39:52 +0000 (11:39 -0700)]
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

13 years agoAdd NETLINK_ROUTE socket creation and event propagation
Stan Chesnutt [Wed, 5 Jan 2011 19:47:37 +0000 (11:47 -0800)]
Add NETLINK_ROUTE socket creation and event propagation

Change-Id: I8cc8788661640600bceadeba8169e239bba98dec

13 years agoAdd missing include headers for compilation on x86 targets.
Olivier Bailly [Wed, 17 Nov 2010 19:45:07 +0000 (11:45 -0800)]
Add missing include headers for compilation on x86 targets.

Change-Id: I99f7b79bfb5b6305a0772f418a54ace50cac1bbe

13 years agoam f444b341: Merge aaf2e765 from open-source master
Jean-Baptiste Queru [Thu, 4 Nov 2010 17:57:44 +0000 (10:57 -0700)]
am f444b341: Merge aaf2e765 from open-source master

* commit 'f444b341768afcdb3f0934c068f3ead6bafdab78':
  Include <bluedroid/bluetooth.h> only if HAVE_BLUETOOTH is defined.

13 years agoMerge aaf2e765 from open-source master
Jean-Baptiste Queru [Thu, 4 Nov 2010 14:28:45 +0000 (07:28 -0700)]
Merge aaf2e765 from open-source master

Change-Id: I523c3e7def1d8dc1c9fa9308143bee952e73eeb9

13 years agoMerge "Include <bluedroid/bluetooth.h> only if HAVE_BLUETOOTH is defined."
Jean-Baptiste Queru [Wed, 3 Nov 2010 21:53:07 +0000 (14:53 -0700)]
Merge "Include <bluedroid/bluetooth.h> only if HAVE_BLUETOOTH is defined."

13 years agoFix the DNS proxy again, for reals.
Brad Fitzpatrick [Tue, 2 Nov 2010 18:48:20 +0000 (11:48 -0700)]
Fix the DNS proxy again, for reals.

me == the suck this morning

Bug: 3157030
Change-Id: Ib87ed047cd6999ee3d29b392acc7a559d9bb7349

13 years agoFix DNS proxy.
Brad Fitzpatrick [Tue, 2 Nov 2010 17:50:55 +0000 (10:50 -0700)]
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