Commit graph

69 commits

Author SHA1 Message Date
Elliott Hughes
857e112443 am e6594658: am 8623dc75: Merge "Fix freeaddrinfo(NULL)."
* commit 'e6594658f7d36172007a2573e345d6ae0d0ac58a':
  Fix freeaddrinfo(NULL).
2015-01-09 02:58:56 +00:00
Elliott Hughes
c62a4b5a7a Fix freeaddrinfo(NULL).
Bug: https://code.google.com/p/android/issues/detail?id=13228
Change-Id: I5e3b126d90d750a93ac0b8872198e50ba047e603
2015-01-08 17:28:46 -08:00
Yabin Cui
598f86661d am e4d3161a: am 4c30fedf: Merge "Move gethtnamaddr.c to net/ subdirectory."
* commit 'e4d3161a84c0373d35f43f981559212a9ae44397':
  Move gethtnamaddr.c to net/ subdirectory.
2014-12-20 03:26:19 +00:00
Yabin Cui
a2177c6ccb Move gethtnamaddr.c to net/ subdirectory.
It may be the better place to stay.

Change-Id: I517cc2769f63e1873191768c4732907c14f2c60e
2014-12-19 17:29:04 -08:00
Yabin Cui
b695cb47c3 am be327941: am e28a1864: Merge "Support gethostbyname_r_ERANGE."
* commit 'be32794141e95ea5d65626bbf29be95b9d974d54':
  Support gethostbyname_r_ERANGE.
2014-12-19 23:02:51 +00:00
Yabin Cui
7069256495 Support gethostbyname_r_ERANGE.
Bug: 18802601
Change-Id: Iaa64921e96f91e330f1845c5399ee8aba39d9c10
2014-12-19 14:11:29 -08:00
Yabin Cui
858e239094 am 9a734138: am 370a3e57: Merge "Sync with upstream for gethnamaddr.c."
* commit '9a734138138fcde0a2f0935e86246b9d7ff0ccb1':
  Sync with upstream for gethnamaddr.c.
2014-12-18 21:49:52 +00:00
Yabin Cui
58d33a51f3 Sync with upstream for gethnamaddr.c.
Bug: 18566967
Change-Id: I37e7410226b49eec67614e20b2c1d5e3e47817a5
2014-12-17 16:19:27 -08:00
Yabin Cui
bb3579f878 am 96cd50f2: am 0e32e39d: Merge "Fix pthread key num calculation."
* commit '96cd50f2fc33b0d342f1733894b06fd59a725519':
  Fix pthread key num calculation.
2014-12-13 03:03:51 +00:00
Yabin Cui
6c238f2926 Fix pthread key num calculation.
Bug: 18723085
Change-Id: Iba2c834b350e4cdba0b2d771b221560a3e5df952
2014-12-12 17:00:08 -08:00
Elliott Hughes
a70d54786f am 1dff030e: am e7b8bc4e: Merge "Clean up DNS proxying."
* commit '1dff030e6eb527eeb4e7ed163cf19641fdb3872b':
  Clean up DNS proxying.
2014-12-11 18:55:55 +00:00
Elliott Hughes
9773fa3ffd Clean up DNS proxying.
Remove code duplication and fall back to trying directly if the proxy
isn't available. With this, tests still work if netd is dead (perhaps
because you've run "adb shell stop", or because you're running on the host).

Bug: 18547878
Change-Id: Ia4a9aa18b1fc79e09735107246989fa7fc6c8455
2014-12-10 17:14:02 -08:00
Lorenzo Colitti
8a94b864bf am e5477f83: Fail queries fast if no DNS servers are configured.
* commit 'e5477f83b0a639b86d8cbe710f25d9808a8f72af':
  Fail queries fast if no DNS servers are configured.
2014-12-02 07:00:47 +00:00
Lorenzo Colitti
e5477f83b0 Fail queries fast if no DNS servers are configured.
When no DNS servers are configured (and thus there is no chance
that the DNS query will suceed), res_nsend returns early, but
it does not tell the cache that the query has failed.
Therefore, if the caller retries the query, it will block for
PENDING_REQUEST_TIMEOUT (= 20 seconds) waiting for the "existing
query" (which isn't actually doing anything) to complete.

Bug: 18240188
Bug: 18327075
Change-Id: I0df13ff4a17ee65e640be96695a3af31b020963a
2014-12-01 20:03:25 +00:00
Robert Alm
3638a83657 Add error-check when mapping socket to fd
The call to fdopen can fail in several ways.
The fprintf on the next line will then dereference a
NULL-pointer FILE*.
Added a NULL-check, closed the socket, returned system error
and added a comment about it.

Change-Id: I7a6b26aa3c79452b1fdd76af12dfa75da88cbad7
2014-11-27 11:01:50 -08:00
Elliott Hughes
55293c1dad Don't receive structs containing pointers over sockets.
Fixes x86-64 netd.

Change-Id: Iee5ef802ebbf2e000b2593643de4eec46f296c04
2014-11-12 22:06:35 -08:00
Elliott Hughes
ac5df33e09 am 6c5694b6: Merge "Migrate system/extra getaddrinfo test, and fix a bug in getservbyname(3)."
* commit '6c5694b6c8343d740c36adbe904442cecd8030a6':
  Migrate system/extra getaddrinfo test, and fix a bug in getservbyname(3).
2014-10-28 04:33:09 +00:00
Derek Xue
ba811120ae Migrate system/extra getaddrinfo test, and fix a bug in getservbyname(3).
This change is to migrate the getaddrinfo tests defined in the old file
system/extras/tests/bionic/libc/common/test_getaddrinfo.c
to the new place bionic/tests/netdb_test.cpp.

The test here is more thorough, and catches a bug in getservbyname(3)
that was breaking getaddrinfo(3)'s ability to look up services by name
without a hint that would cause it to ask for a specific protocol.

Change-Id: Ief5ebd0869496d1bc6a97861dfefa04bdf24bab1
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2014-10-22 22:23:10 -07: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
Elliott Hughes
d87d401ab1 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.

Bug: 17784968

(cherry picked from commit 2cfb4e8e2e)

Change-Id: I5e96146f92c0521248c78c0933bec5e9a9818222
2014-10-07 11:40:09 -07:00
Lorenzo Colitti
33a73bfa07 When comparing DNS server configs, also compare number of servers
Bug: 16070602
Change-Id: I605f1cca50b08479ebcad290b3bd179f59be8a96
2014-09-11 08:36:12 +09: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
1b6b56a9a6 am 7134fc30: Merge "Regenerate "services.h" from /etc/services."
* commit '7134fc30892bff763e7c24ac722151e0777b5409':
  Regenerate "services.h" from /etc/services.
2014-08-20 20:49:21 +00: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
Elliott Hughes
c4a1de1ae2 Regenerate "services.h" from /etc/services.
Change-Id: Iec118f9a342b5c1f6ce6d48965798b12a7159ad3
2014-08-20 12:11:31 -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
Elliott Hughes
dd9efcbab6 am c5f1504e: am 6cdab387: Merge "Restore <nsswitch.h> which is BSD API, not private."
* commit 'c5f1504e3db3a39bb951bf01e2d0d758ca93cc44':
  Restore <nsswitch.h> which is BSD API, not private.
2014-06-30 23:16:01 +00:00
Nick Kralevich
bcf77b5dff Merge "add CLOEXEC to various DNS related code" 2014-06-30 22:26:48 +00:00
Elliott Hughes
a311704103 Restore <nsswitch.h> which is BSD API, not private.
Also make nsdispatch non-hidden. Firefox uses it.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1030899
Change-Id: Iaccc1ec813d196ec91ac475fcc4ae9dca756861d
2014-06-30 14:15:34 -07:00
Elliott Hughes
71ee128e0c am e1047515: am f72c56d6: Merge "Switch to upstream NetBSD nsap_addr.c."
* commit 'e104751566da6e8ef340926781d5ef120bf1d801':
  Switch to upstream NetBSD nsap_addr.c.
2014-06-30 19:44:47 +00:00
Elliott Hughes
a210cae724 Switch to upstream NetBSD nsap_addr.c.
These symbols should be public (and Firefox uses them), and we'd also probably
rather have the upstream thread-safe implementation.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1030899
Change-Id: I2a5888fbb3198546848398f576fd2195ff3fe00c
2014-06-30 12:03:43 -07: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
Elliott Hughes
1f29fd72c8 am 7e6f6965: am 1e7ae47d: Merge "Bring our "libresolv" stuff in line with glibc."
* commit '7e6f6965982183ebae357e61e7bad55b91e97cc9':
  Bring our "libresolv" stuff in line with glibc.
2014-06-13 21:50:45 +00:00
Elliott Hughes
62e50ea8de am 294cae0f: am 1aaed87f: Merge "Somewhere, the declaration of _resolv_delete_cache_for_net went missing."
* commit '294cae0f18ceae96e1a5f8b42ae9fd8064b98746':
  Somewhere, the declaration of _resolv_delete_cache_for_net went missing.
2014-06-13 01:51:30 +00:00
Elliott Hughes
b38018f786 am c189362d: am 564222e3: Merge "Use default hidden visibility to build libc_dns."
* commit 'c189362d879520243cc9e1ba65b9828165efa159':
  Use default hidden visibility to build libc_dns.
2014-06-13 00:48:44 +00:00