Commit graph

32 commits

Author SHA1 Message Date
Elliott Hughes
4dcfccff8d Remove unused CONFIG_SECONDS.
Bug: https://code.google.com/p/android/issues/detail?id=65951
Change-Id: I8ae7057c68e16618de6dd06cf052426c6cad8a3d
2015-01-29 21:47:37 -08:00
Elliott Hughes
5c7964c5f1 Merge "Clean up <stdlib.h> slightly." 2015-01-27 04:49:07 +00:00
Elliott Hughes
76f8916b90 Clean up <stdlib.h> slightly.
Interestingly, this mostly involves cleaning up our implementation of
various <string.h> functions.

Change-Id: Ifaef49b5cb997134f7bc0cc31bdac844bdb9e089
2015-01-26 14:28:41 -08:00
Lorenzo Colitti
616344d169 Make bionic compile even if resolver debugging is enabled.
The code now compiles with all combinations of DEBUG and
DEBUG_DATA except DEBUG_DATA=1, DEBUG=0, which is unsupported.

Change-Id: I9035a65c649df73092f1fc0864ae1cdd9a14aa3b
2015-01-26 16:05:27 +09:00
Patrick Tjin
a6a0949b1d Fix build error when XLOG is enabled
(cherrypick of 79a49c9857f3949fc13373eeb179f27b6ecdca81.)

Change-Id: I7bb44fd1fe3ef2ddfc115247f328eccfceeb5352
Signed-off-by: Patrick Tjin <pattjin@google.com>
2015-01-20 16:12:45 -08:00
Yabin Cui
6c238f2926 Fix pthread key num calculation.
Bug: 18723085
Change-Id: Iba2c834b350e4cdba0b2d771b221560a3e5df952
2014-12-12 17:00:08 -08:00
Dan Albert
a2220ffb74 am 72d72d91: Merge "Replace uses of sprintf(3) with snprintf(3)."
* commit '72d72d91262fabe6bc169618ef3acb0721441cf0':
  Replace uses of sprintf(3) with snprintf(3).
2014-10-09 00:13:06 +00:00
Dan Albert
cfd8c45725 Replace uses of sprintf(3) with snprintf(3).
At -00, the compiler warns about sprintf(3), and it is promoted to an
error by -Werror.

Change-Id: Ibb380d27d7eb09dda8ac785be2478d656b379190
2014-10-08 16:12:27 -07:00
Lorenzo Colitti
da0ed4cbfa am c71483c0: Merge "When comparing DNS server configs, also compare number of servers"
* commit 'c71483c0b38a6b4f2675f0bffa221dcf175c34ac':
  When comparing DNS server configs, also compare number of servers
2014-09-09 10:42:23 +00:00
Lorenzo Colitti
c71483c0b3 Merge "When comparing DNS server configs, also compare number of servers" 2014-09-09 10:22:18 +00:00
Lorenzo Colitti
bce18c9163 When comparing DNS server configs, also compare number of servers
Bug: 16070602
Change-Id: I605f1cca50b08479ebcad290b3bd179f59be8a96
2014-09-09 19:20:26 +09:00
Elliott Hughes
f975bc2d59 am 7b87d441: Merge "Switch to OpenBSD res_random."
* commit '7b87d441b0f2aa3ad5021ab6bd879a995a1bc2ce':
  Switch to OpenBSD res_random.
2014-08-26 23:41:23 +00:00
Elliott Hughes
06b033942a am 59de803a: Merge "libc should use O_CLOEXEC when opening files for its own use."
* commit '59de803af98a284378303489f614be3e53800b3f':
  libc should use O_CLOEXEC when opening files for its own use.
2014-08-26 23:41:23 +00:00
Elliott Hughes
7b87d441b0 Merge "Switch to OpenBSD res_random." 2014-08-26 23:18:04 +00:00
Elliott Hughes
c674edbf27 libc should use O_CLOEXEC when opening files for its own use.
Change-Id: I159f1d57e0ca090d837f57854fcef5879b8b8248
2014-08-26 15:56:54 -07:00
Elliott Hughes
c228979648 am 205cc415: Merge "Improve <sys/cdefs.h>."
* commit '205cc41556d44b104a21bc6839b7ea44f72df9ba':
  Improve <sys/cdefs.h>.
2014-08-18 22:28:12 +00:00
Elliott Hughes
2cfb4e8e2e Improve <sys/cdefs.h>.
Fix and use __RENAME (and lose ___RENAME --- two underscores should be
enough for anybody). This was the point of this change, because I want
to use __RENAME to support the two basename variants and the two
strerror_r variants.

Lose a bunch of macros that weren't being used.

Lose three dead files from the DNS code.

Change-Id: I3ef645c566b16a52217bc2e68c7d54b37c7c9522
2014-08-18 14:45:42 -07:00
Paul Jensen
1544eae56e Revert most of "Cleanup: Delete dead code."
This reverts most of commit 2582f02a01.
The DNS cache flushing code needs to be called when routes change.

Change-Id: I5b04121bc428cc6a2e136b6c3269c395bfb4981f
bug:16549455
2014-08-06 13:38:16 -04:00
Sreeram Ramachandran
2582f02a01 Cleanup: Delete dead code.
Bug: 15413389
Change-Id: I315468832ef18ffc84174e54774ab63b86d284dc
2014-07-22 11:24:17 -07:00
Elliott Hughes
0f7d882bb7 Switch to OpenBSD res_random.
Change-Id: Ia971d647832893e9bb4601697132a105524d2f96
2014-07-21 15:31:53 -07:00
Elliott Hughes
88ed7d2cc1 am d5a6a5e1: am db42a9f5: Merge "Fix three clang complaints about the DNS code."
* commit 'd5a6a5e18d66543bdfa4dffdfeec80eff32a87b9':
  Fix three clang complaints about the DNS code.
2014-07-07 18:08:47 +00:00
Elliott Hughes
cda4006cc7 am 2a70aba8: am ab4fc823: Merge "Fix all resolv warnings and turn on -Werror."
* commit '2a70aba8460eff1bfb1417c271c6a5a53c560afa':
  Fix all resolv warnings and turn on -Werror.
2014-07-02 23:54:12 +00:00
Elliott Hughes
37b1b5bbcd Fix all resolv warnings and turn on -Werror.
The res_init.c changes bring us a bit closer to upstream too, though
there's still work to be done there. Some of the remaining differences
look like bugs we'd want to fix, so we should definitely try to come
back to that.

Change-Id: I50baa148e967c90d55d711e9904ad54c7d724d4d
2014-07-02 16:27:20 -07:00
Elliott Hughes
68c2755d71 Fix three clang complaints about the DNS code.
These are all already fixed upstream in the same way.

Change-Id: I2881b6d0fbd0237fffc0f00563bc14750dcce0d9
2014-07-07 09:44:17 -07:00
Nick Kralevich
b18a1c3d19 am e844f27a: am bcf77b5d: Merge "add CLOEXEC to various DNS related code"
* commit 'e844f27a05b32b7bf2fd68b1bd69e450040c1e24':
  add CLOEXEC to various DNS related code
2014-06-30 23:23:47 +00:00
Nick Kralevich
1781ed7774 add CLOEXEC to various DNS related code
Occasionally file descriptors seem to be leaking across execs
from DNS related calls. Set close-on-execute for the various
sockets / file to prevent file descriptor leakage.

Change-Id: I4724b47bc7236f40c29518a6075598a9bba48b0a
2014-06-29 20:46:17 -07:00
Paul Jensen
31ad03761d Make host resolver call __connect() rather than connect() so mark isn't cleared.
Calling connect() will erase the mark set by the host resolver code because the
explicitlySelected bit of the Fwmark isn't set.  It's by design that the
explicitlySelected bit isn't set as this facilitates falling through to other
routing rules if the selected network doesn't provide a route to the DNS server
as may be the case with VPNs.

Change-Id: I60ba7c754194ead97df3ac6a6c5b3db1f446dac8
2014-05-30 08:02:52 -04:00
Paul Jensen
41d9a50371 Add support for deleting per-network DNS resolver caches.
This is required when the possible range of NetIds is large to
prevent netd consuming excessive amounts of memory.
This required replacing the per-cache locks in favor of a single
global lock to prevent accesses to deleted caches.

Change-Id: I99d058bafea5de743e56075dbed74031da4df63f
2014-05-14 04:16:18 -07:00
Szymon Jakubczak
ea9bf67881 bionic: Replace iface with opaque netid in resolver.
Replace iface cache key with netid.

Replace _mark with netid.

Mark sockets used to test IPv4/IPv6 support as well as sockets
used to determine source address for rfc6724 sort.

Remove pid/uid mappings (functionality moved to system/netd).

Do not create resolv_cache when it does not exist, but rather only
when DNS configuration is supplied.

Clean up unused functions.

Change-Id: I9ccfda2902cc0943e87c9bc346ad9a2578accdab
2014-04-01 16:25:49 -04:00
Calin Juravle
0ad555a908 Update res_debug.c to take into account changes
to the nameser.h

Bug: 13219633
Change-Id: Id75de2e8933f716ad86ca296a97f5c619fb946a7
2014-03-07 20:03:57 +00:00
Calin Juravle
569fb9887d Moved nameser.h and namser_compat.h to public include dir
This is part of the upstream sync (Net/Open/Free BSDs expose the
nameser.h in their public headers).

Change-Id: Ib063d4e50586748cc70201a8296cd90d2e48bbcf
2014-03-04 15:07:07 +00:00
Calin Juravle
bd33537fde Renamed the misleading libc/netbsd directory to libc/dns.
Bug: 13219633
Change-Id: Ide43add0b90b3081cc709a22d1ff1f59d65f1104
2014-02-28 16:31:04 +00:00