summaryrefslogtreecommitdiffstats
path: root/libc/netbsd/resolv
Commit message (Collapse)AuthorAgeFilesLines
* Renamed the misleading libc/netbsd directory to libc/dns.Calin Juravle2014-02-2815-7827/+0
| | | | | Bug: 13219633 Change-Id: Ide43add0b90b3081cc709a22d1ff1f59d65f1104
* Remove two DNS files that weren't being built.Elliott Hughes2014-02-202-362/+0
| | | | | | And switch the makefile to just building everything in the relevant directory. Change-Id: Ia7785c4dcabb51639c2230026f8a8a9eff919a36
* Remove a __system_property_get call from the DNS code.Elliott Hughes2014-01-281-28/+5
| | | | Change-Id: I48082ad9eb1b56349c6746ab2c371728c8571a81
* Fix dns search domain use in gethostbyname.Robert Greenwalt2013-12-111-0/+9
| | | | | | | Need to load search domain data before we attempt to use it. bug:6799630 Change-Id: Ib228f4ca260339f71a2e28d5930c0a722bd43c92
* am 8826ba8a: am bc545e8a: Merge "Fix x86_64 build, clean up intermediate ↵Elliott Hughes2013-10-093-3/+3
|\ | | | | | | | | | | | | libraries." * commit '8826ba8ab6922927bdac2466d2903916d5806a06': Fix x86_64 build, clean up intermediate libraries.
| * Fix x86_64 build, clean up intermediate libraries.Elliott Hughes2013-10-093-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The x86_64 build was failing because clone.S had a call to __thread_entry which was being added to a different intermediate .a on the way to making libc.so, and the linker couldn't guarantee statically that such a relocation would be possible. ld: error: out/target/product/generic_x86_64/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(clone.o): requires dynamic R_X86_64_PC32 reloc against '__thread_entry' which may overflow at runtime; recompile with -fPIC This patch addresses that by ensuring that the caller and callee end up in the same intermediate .a. While I'm here, I've tried to clean up some of the mess that led to this situation too. In particular, this removes libc/private/ from the default include path (except for the DNS code), and splits out the DNS code into its own library (since it's a weird special case of upstream NetBSD code that's diverged so heavily it's unlikely ever to get back in sync). There's more cleanup of the DNS situation possible, but this is definitely a step in the right direction, and it's more than enough to get x86_64 building cleanly. Change-Id: I00425a7245b7a2573df16cc38798187d0729e7c4
| * Change how DNS resolver handle no default ifaceRobert Greenwalt2013-08-221-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to just try any iface we'd been told about as a fallback, but that will end up mistakenly using a secondary network's dns when we really don't have a default connection. It also messed up our detection of whether we were doing the lookup on the default or not (we'd get back our secondary net iface as the default, do the compare and think we were on default). Remove the lies and let dns fail if we don't have an iface for it. bug:10132565 Change-Id: I5f0f2abacaaaaf23c5292b20fba9d8dcb6fb10c5
| * am 977a3313: Merge changes Iac00ce10,I192d3825Colin Cross2013-06-171-3/+3
| |\ | | | | | | | | | | | | | | | * commit '977a33137d2be0093f474055f839cf665b82b588': bionic: add tests for properties bionic: move system property writing from init to bionic
| | * bionic: move system property writing from init to bionicColin Cross2013-06-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the implementation of writing to the system property area from init to bionic, next to the reader implementation. This will allow full property testing to be added to bionic tests. Add new accessor and waiting functions to hide the implementation from watchprops and various bionic users. Also hide some of the implementation details of the property area from init by moving them into _system_properties.h, and other details from everybody by moving them into system_properties.h. (cherry picked from commit dc1038b7900acb664e99643d2974e1a0f4703781) Change-Id: I192d3825ee276c5047bc751039fe6cfe226a7cca
* | | Change how DNS resolver handle no default ifaceRobert Greenwalt2013-08-231-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to just try any iface we'd been told about as a fallback, but that will end up mistakenly using a secondary network's dns when we really don't have a default connection. It also messed up our detection of whether we were doing the lookup on the default or not (we'd get back our secondary net iface as the default, do the compare and think we were on default). Remove the lies and let dns fail if we don't have an iface for it. bug:10132565 Conflicts: libc/netbsd/resolv/res_cache.c Change-Id: I357a9c34dad83215f44c5e0dd41ce2a7d6fe8f3f
* | | Add marking of DNS sockets for mark based routingChad Brubaker2013-07-092-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | Adds an extra mark parameter to android_getaddrinfoforiface, android_gethostbyaddrforiface and android_gethostbynameforiface that if set will cause all packets sent by DNS requests to have that mark Change-Id: I6f72390e4ce5bfc3cc73183f9b2fb3705a11685f
* | | Merge "Fix remove_uidiface_info failing on first entry"Geremy Condra2013-06-181-1/+1
|\ \ \
| * | | Fix remove_uidiface_info failing on first entryChad Brubaker2013-06-141-1/+1
| | | | | | | | | | | | | | | | Change-Id: Ic23506581ff835a6b679e1593eab550a84548056
* | | | bionic: move system property writing from init to bionicColin Cross2013-06-171-3/+3
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the implementation of writing to the system property area from init to bionic, next to the reader implementation. This will allow full property testing to be added to bionic tests. Add new accessor and waiting functions to hide the implementation from watchprops and various bionic users. Also hide some of the implementation details of the property area from init by moving them into _system_properties.h, and other details from everybody by moving them into system_properties.h. Change-Id: I9026e604109e30546b2849b60cab2e7e5ff00ba5
* | | Add clearing of resolv uid and pid interface mapsChad Brubaker2013-06-071-19/+55
| | | | | | | | | | | | | | | | | | Cleanup uid interface map variable names Change-Id: I712dd83276bb23b149af4180515ef33a1bade5ea
* | | Add per UID interface support to resolv cacheChad Brubaker2013-06-061-0/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add methods to attach/detach UID ranges to a specific dns cache/interface. This mirrors the already existing code for attaching specific processes to specific interfaces but will be used to push all processes from a given user to a specific cache/interface. Change-Id: Ic24391e92d3ca46fcb46cc4fc53e13984dec40b3
* | | am 509fc806: am d8a9cccb: Merge "Fix all printf warnings in res_send.c."Elliott Hughes2013-05-141-4/+4
|\ \ \ | |/ / | | | | | | | | | * commit '509fc8069757aa6091e044f659f76da0bf59723c': Fix all printf warnings in res_send.c.
| * | am d8a9cccb: Merge "Fix all printf warnings in res_send.c."Elliott Hughes2013-05-141-4/+4
| |\ \ | | |/ | | | | | | | | | * commit 'd8a9cccb4d77eecc36425c9240a12bd305031ee3': Fix all printf warnings in res_send.c.
| | * Fix all printf warnings in res_send.c.Kito Cheng2013-05-141-4/+4
| | | | | | | | | | | | Change-Id: I4bf959140b5a5475897bd80704e64e3c4645fc3f
* | | am cf23cbb1: am 12ea8005: am 5f829205: am c1416647: Merge "Clean up internal ↵Elliott Hughes2013-03-153-25/+20
|\ \ \ | |/ / | | | | | | | | | | | | | | | libc logging." * commit 'cf23cbb1d4826ac579fae28e4fe796a6e4e1ddfd': Clean up internal libc logging.
| * | am 5f829205: am c1416647: Merge "Clean up internal libc logging."Elliott Hughes2013-03-153-25/+20
| |\ \ | | |/ | | | | | | | | | * commit '5f8292050fc07f4bf9e70f37a807ad028e3cfc87': Clean up internal libc logging.
| | * Clean up internal libc logging.Elliott Hughes2013-03-153-26/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only need one logging API, and I prefer the one that does no allocation and is thus safe to use in any context. Also use O_CLOEXEC when opening the /dev/log files. Move everything logging-related into one header file. Change-Id: Ic1e3ea8e9b910dc29df351bff6c0aa4db26fbb58
* | | Bionic: Libc: Resolv: Stricter function signatures, unitialized return bug fix.Sasha Levitskiy2013-02-281-31/+31
|/ / | | | | | | | | | | | | | | | | | | | | Stricter input parameters help avoid ugly casting when passing pointers to immutable protobuf data. While at it: an int return was dropped from 2 functions whose users never used the result; one of the return paths was returning an uninitialized value. Size_t for portablity and warning supression, misc warnings addressed. Change-Id: I2d5cbdaf0c9b6c4621a7d397772da13da5dc0943
* | dns cache per interface iteration 2Mattias Falk2013-02-075-184/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | name server addresses are read from the dns cache associated wih the interface on which the request shall be done. processes which has requested to issue dns request using specific interface are now proxied to netd. added methods to attach/detach a process to a specific dns cache/interface. added getaddrinfoforinface method which takes an interface as an argument. bug:4815099 bug:5465296 Change-Id: I7a8fe1980cdf99d4d296ddc5c6411f0c72162263
* | Revert "dns cache per interface iteration 2"Robert Greenwalt2013-01-195-336/+174
| | | | | | | | | | | | This reverts commit f1464ff95670e6dcc0e12bf9fbbeb4c0346434c9 Change-Id: I3496b9a8cb54614fe3eea016d1391c8a89f3db38
* | dns cache per interface iteration 2Mattias Falk2013-01-115-174/+336
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | name server addresses are read from the dns cache associated wih the interface on which the request shall be done. processes which has requested to issue dns request using specific interface are now proxied to netd. added methods to attach/detach a process to a specific dns cache/interface. added getaddrinfoforinface method which takes an interface as an argument. Change-Id: I851ec8ab8ce3112626ad2a729078b91d013f32fd bug:4815099 bug:5465296
* | Cache negative DNS results.Robert Greenwalt2013-01-091-19/+67
| | | | | | | | | | | | | | | | Find the TTL for the negative results using the minimum of the SOA records TTL or the MINIMUM-TTL field (RFC-2308). bug:5926539 Change-Id: I6d39c9fb558afcb7a4a5bc014d97dab4a85c0d4f
* | Add search domain to dns interface data.Robert Greenwalt2012-11-131-1/+4
|/ | | | | | | | This doesn't currently use this info - it's still using the system property based data-passing. That change is comming. bug:6799630 Change-Id: I725463209855447cd04bf1457281f3084fffd692
* Added missing cache failed notificationHenrik Engström2012-08-171-0/+5
| | | | | | | | | | Added a missing call to _resolv_cache_query_failed for another fail case where it was missing (it doesn't go through the error handling under the "fail" label). This missing notification caused requests to have to wait for timeout instead of beeing notified on some failed requests. Change-Id: I904d60269c59b926784e3a397d2a860329f55142
* am c5cab345: am 028ccf5d: Merge "Avoid multiple dns lookups for the same query"Robert Greenwalt2012-06-122-1/+129
|\ | | | | | | | | * commit 'c5cab3452d5ced55474e56497594579108670b51': Avoid multiple dns lookups for the same query
| * am 028ccf5d: Merge "Avoid multiple dns lookups for the same query"Robert Greenwalt2012-06-122-1/+129
| |\ | | | | | | | | | | | | * commit '028ccf5d40dd9a945ea92aa79822c08c6f6aa1d2': Avoid multiple dns lookups for the same query
| | * Avoid multiple dns lookups for the same queryMattias Falk2012-05-072-1/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If two or more rapid dns requests for the same server are done from different threads it turns into separate dns reques, if the response of the request isn't found in the cache. This patch avoid multiple request for the same server by letting subsequents request wait until the first request has finished. Change-Id: Ic72ea0e7d3964a4164eddf866feb4357ec4dfe54
* | | Added event logging for some spoofed DNS queries.Geremy Condra2012-06-111-0/+9
|/ / | | | | | | Change-Id: I40909306e8cf922f1dd5a5685db89f732a709794
* | am 03539a36: Merge "Ensure that the port number and TXID are properly ↵Geremy Condra2012-05-301-1/+37
|\ \ | | | | | | | | | | | | | | | | | | randomized." into jb-dev * commit '03539a36b634bdfa61c06277cf25e0ca8e3105ba': Ensure that the port number and TXID are properly randomized.
| * | Ensure that the port number and TXID are properly randomized.Geremy Condra2012-05-241-1/+37
| | | | | | | | | | | | | | | | | | | | | This fix reads from /dev/urandom to get the required entropy. Bug: 6535492 Change-Id: Ibc2fec3f71a67607b608ad9b767b0b6504993c1d
* | | am 73a6566d: Merge "Remove expired dns cache entries before removing oldest"Elliott Hughes2012-05-071-1/+25
|\ \ \ | |/ / |/| / | |/ | | * commit '73a6566da337db50cfc73c369d774ac1905a30c2': Remove expired dns cache entries before removing oldest
| * Merge "Remove expired dns cache entries before removing oldest"Elliott Hughes2012-05-071-1/+25
| |\
| | * Remove expired dns cache entries before removing oldestAnders Fredlund2011-05-201-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | A suggestion how to make a smarter delete function when the cache is full. First look through the entire cache and remove all entries which have expired. If none use the old solution and just remove the last entry in the MRU list. Change-Id: I5f997ab35290a55dc6e1ddf37d725759edf83d36
* | | Increase the size of the system-wide dns cacheRobert Greenwalt2012-01-251-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | 32 enteries perhaps was ok for per-process caching with ipv4 only but adding ipv6 records makes it effectively 16 entries and making it system wide makes is pretty useless. Increasing to 640 entries. bug:5841178 Change-Id: I879f8bf4d3c4d8c1708bb46d46a67c1f64b1861f
* | | Merge "libc: remove private declarations from <time.h> and <resolv.h>"David 'Digit' Turner2012-01-191-0/+1
|\ \ \ | |/ / |/| |
| * | libc: remove private declarations from <time.h> and <resolv.h>David 'Digit' Turner2012-01-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is used to remove private C library declarations from the public headers (that are exported to the NDK). It should *only* be submitted after all other patches modifying the users of said private functions have been submitted to the tree, to avoid breakages. Change-Id: I0a5e3014f8e3ac9ed8df86a5cdae506337c23252
* | | am eae1f1fb: Merge "res_send: Avoid spurious close()s and (rare) failure"Jean-Baptiste Queru2012-01-171-1/+1
|\ \ \ | | | | | | | | | | | | | | | | * commit 'eae1f1fba33cb105302227b044a14e5abcbe55e7': res_send: Avoid spurious close()s and (rare) failure
| * | | res_send: Avoid spurious close()s and (rare) failureJim Huang2012-01-141-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | When looping over the current list of sockets we are connected to, use getpeername() not getsockname() to find out who the remote end is. This change avoids spurious close() and (rare) failure. Origin: ISC bug #18625 and fixed in libbind 6.0 Change-Id: I5e85f9ff4b98c237978e4bf4bd85ba0a90d768e6
* | | Adding a timeout to tcp dns lookup connects.Robert Greenwalt2012-01-121-26/+168
|/ / | | | | | | | | | | | | | | | | | | | | TCP isn't supported on some dns servers, which makes the old code hang forever. NOT adding a stopship to remove debugging stuff - it was too painful (14s timeout on failed tcp dns lookups) so we decided not to bother people. bug:5766949 Change-Id: I381c20c3e11b8e994438d4f7c58ef643cd36554e
* | Add some logging of dns cache operationsRobert Greenwalt2011-09-021-0/+5
| | | | | | | | | | | | Added info about what entries are getting flushed due to ttl or size limits. Change-Id: I69fb70ce23b5b820f5f1a5738c0f1aa57b6a1127
* | resolved conflicts for merge of 9363d912 to honeycomb-plus-aospRobert Greenwalt2011-07-261-12/+13
|\ \ | | | | | | | | | Change-Id: I555f5c10da9770feacdbece9fd77729d6151bfba
| * | Add per-interface dns caches.Robert Greenwalt2011-07-262-19/+430
| | | | | | | | | | | | | | | | | | import of changes 22100 and 23138 from opensource. Change-Id: I3ce86394323d269272aeb2bebeed4374f171a8cf
* | | am fed31359: am f6fcdb2e: am 28de3e59: Merge "Don\'t reset caches when dns ↵Robert Greenwalt2011-07-201-1/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | props change." * commit 'fed3135972f9725a44a7d9b3df728e311ac1a130': Don't reset caches when dns props change.
| * | | Don't reset caches when dns props change.Mattias Falk2011-07-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This happens too frequently. We should flush a per-interface cache when it's dns server addrs changes. Change-Id: I8a691c96ce9a775160ef55ddb8f755d649041583
* | | | am e0a4b678: am cc32fbc3: Merge "Add support for a dns cache per interface"Robert Greenwalt2011-06-271-17/+428
|\ \ \ \ | |/ / / | | | | | | | | | | | | * commit 'e0a4b67811981ab4c04c437b23c36ae42c444bce': Add support for a dns cache per interface