Commit graph

3 commits

Author SHA1 Message Date
Sreeram Ramachandran
6af621f792 Use a function instead of a macro.
(cherry picked from commit f3e4a8bb245afe874561eb7275f49dae0e7e55dd)

Change-Id: If5359c26a1474de0c278193fd2f09168f3184dee
2014-05-14 11:15:20 -07:00
Sreeram Ramachandran
b87b17a895 Mark sockets on accept().
(cherry picked from commit 1321cfecc6fb0e075796a34ed3c6a30d7ff3bea3)

Change-Id: I5d09be413cf720fbed905f96313b007997ada76c
2014-05-14 11:14:41 -07:00
Sreeram Ramachandran
154ebe80a0 Introduce netd_client, a dynamic library that talks to netd.
This library is dynamically loaded and used by bionic, to replace selected
standard socket syscalls with versions that talk to netd.

Implement connect() by requesting that the socket be marked with the netId of
the default network and then calling through to the actual syscall.

There are two escape hatches:

+ If the fwmark server is unavailable, it isn't an error; we proceed with the
  syscall. This might help at boot time (when the server isn't ready yet) and if
  we get rid of the fwmarkd socket entirely in future platform versions.

+ If the ANDROID_NO_USE_FWMARK_CLIENT environment variable is set, we don't
  attempt to use the fwmark server (even if it's available). This allows apps to
  sidestep unforseen issues in production at runtime.

(cherry picked from commit 0581cb455ef924f128a5c6d46bc70868b5099eec)

Change-Id: Ib6198e19dbc306521a26fcecfdf6e8424d163fc9
2014-05-14 11:13:53 -07:00