summaryrefslogtreecommitdiff
path: root/libc/netbsd/resolv
AgeCommit message (Collapse)Author
2014-02-28Renamed the misleading libc/netbsd directory to libc/dns.Calin Juravle
Bug: 13219633 Change-Id: Ide43add0b90b3081cc709a22d1ff1f59d65f1104
2014-02-20Remove two DNS files that weren't being built.Elliott Hughes
And switch the makefile to just building everything in the relevant directory. Change-Id: Ia7785c4dcabb51639c2230026f8a8a9eff919a36
2014-01-28Remove a __system_property_get call from the DNS code.Elliott Hughes
Change-Id: I48082ad9eb1b56349c6746ab2c371728c8571a81
2013-12-11Fix dns search domain use in gethostbyname.Robert Greenwalt
Need to load search domain data before we attempt to use it. bug:6799630 Change-Id: Ib228f4ca260339f71a2e28d5930c0a722bd43c92
2013-10-09am 8826ba8a: am bc545e8a: Merge "Fix x86_64 build, clean up intermediate ↵Elliott Hughes
libraries." * commit '8826ba8ab6922927bdac2466d2903916d5806a06': Fix x86_64 build, clean up intermediate libraries.
2013-10-09Fix x86_64 build, clean up intermediate libraries.Elliott Hughes
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
2013-08-23Change how DNS resolver handle no default ifaceRobert Greenwalt
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
2013-08-22Change how DNS resolver handle no default ifaceRobert Greenwalt
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
2013-07-09Add marking of DNS sockets for mark based routingChad Brubaker
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
2013-06-18Merge "Fix remove_uidiface_info failing on first entry"Geremy Condra
2013-06-17am 977a3313: Merge changes Iac00ce10,I192d3825Colin Cross
* commit '977a33137d2be0093f474055f839cf665b82b588': bionic: add tests for properties bionic: move system property writing from init to bionic
2013-06-17bionic: move system property writing from init to bionicColin Cross
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
2013-06-17bionic: move system property writing from init to bionicColin Cross
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
2013-06-14Fix remove_uidiface_info failing on first entryChad Brubaker
Change-Id: Ic23506581ff835a6b679e1593eab550a84548056
2013-06-07Add clearing of resolv uid and pid interface mapsChad Brubaker
Cleanup uid interface map variable names Change-Id: I712dd83276bb23b149af4180515ef33a1bade5ea
2013-06-06Add per UID interface support to resolv cacheChad Brubaker
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
2013-05-14am 509fc806: am d8a9cccb: Merge "Fix all printf warnings in res_send.c."Elliott Hughes
* commit '509fc8069757aa6091e044f659f76da0bf59723c': Fix all printf warnings in res_send.c.
2013-05-14am d8a9cccb: Merge "Fix all printf warnings in res_send.c."Elliott Hughes
* commit 'd8a9cccb4d77eecc36425c9240a12bd305031ee3': Fix all printf warnings in res_send.c.
2013-05-14Fix all printf warnings in res_send.c.Kito Cheng
Change-Id: I4bf959140b5a5475897bd80704e64e3c4645fc3f
2013-03-15am cf23cbb1: am 12ea8005: am 5f829205: am c1416647: Merge "Clean up internal ↵Elliott Hughes
libc logging." * commit 'cf23cbb1d4826ac579fae28e4fe796a6e4e1ddfd': Clean up internal libc logging.
2013-03-15am 5f829205: am c1416647: Merge "Clean up internal libc logging."Elliott Hughes
* commit '5f8292050fc07f4bf9e70f37a807ad028e3cfc87': Clean up internal libc logging.
2013-03-15Clean up internal libc logging.Elliott Hughes
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
2013-02-28Bionic: Libc: Resolv: Stricter function signatures, unitialized return bug fix.Sasha Levitskiy
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
2013-02-07dns cache per interface iteration 2Mattias Falk
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
2013-01-19Revert "dns cache per interface iteration 2"Robert Greenwalt
This reverts commit f1464ff95670e6dcc0e12bf9fbbeb4c0346434c9 Change-Id: I3496b9a8cb54614fe3eea016d1391c8a89f3db38
2013-01-11dns cache per interface iteration 2Mattias Falk
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
2013-01-09Cache negative DNS results.Robert Greenwalt
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
2012-11-13Add search domain to dns interface data.Robert Greenwalt
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
2012-08-17Added missing cache failed notificationHenrik Engström
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
2012-06-12am c5cab345: am 028ccf5d: Merge "Avoid multiple dns lookups for the same query"Robert Greenwalt
* commit 'c5cab3452d5ced55474e56497594579108670b51': Avoid multiple dns lookups for the same query
2012-06-12am 028ccf5d: Merge "Avoid multiple dns lookups for the same query"Robert Greenwalt
* commit '028ccf5d40dd9a945ea92aa79822c08c6f6aa1d2': Avoid multiple dns lookups for the same query
2012-06-11Added event logging for some spoofed DNS queries.Geremy Condra
Change-Id: I40909306e8cf922f1dd5a5685db89f732a709794
2012-05-30am 03539a36: Merge "Ensure that the port number and TXID are properly ↵Geremy Condra
randomized." into jb-dev * commit '03539a36b634bdfa61c06277cf25e0ca8e3105ba': Ensure that the port number and TXID are properly randomized.
2012-05-24Ensure that the port number and TXID are properly randomized.Geremy Condra
This fix reads from /dev/urandom to get the required entropy. Bug: 6535492 Change-Id: Ibc2fec3f71a67607b608ad9b767b0b6504993c1d
2012-05-07Avoid multiple dns lookups for the same queryMattias Falk
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
2012-05-07am 73a6566d: Merge "Remove expired dns cache entries before removing oldest"Elliott Hughes
* commit '73a6566da337db50cfc73c369d774ac1905a30c2': Remove expired dns cache entries before removing oldest
2012-05-07Merge "Remove expired dns cache entries before removing oldest"Elliott Hughes
2012-01-25Increase the size of the system-wide dns cacheRobert Greenwalt
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
2012-01-19Merge "libc: remove private declarations from <time.h> and <resolv.h>"David 'Digit' Turner
2012-01-17am eae1f1fb: Merge "res_send: Avoid spurious close()s and (rare) failure"Jean-Baptiste Queru
* commit 'eae1f1fba33cb105302227b044a14e5abcbe55e7': res_send: Avoid spurious close()s and (rare) failure
2012-01-14res_send: Avoid spurious close()s and (rare) failureJim Huang
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
2012-01-13libc: remove private declarations from <time.h> and <resolv.h>David 'Digit' Turner
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
2012-01-12Adding a timeout to tcp dns lookup connects.Robert Greenwalt
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
2011-09-02Add some logging of dns cache operationsRobert Greenwalt
Added info about what entries are getting flushed due to ttl or size limits. Change-Id: I69fb70ce23b5b820f5f1a5738c0f1aa57b6a1127
2011-07-26resolved conflicts for merge of 9363d912 to honeycomb-plus-aospRobert Greenwalt
Change-Id: I555f5c10da9770feacdbece9fd77729d6151bfba
2011-07-26Add per-interface dns caches.Robert Greenwalt
import of changes 22100 and 23138 from opensource. Change-Id: I3ce86394323d269272aeb2bebeed4374f171a8cf
2011-07-20am fed31359: am f6fcdb2e: am 28de3e59: Merge "Don\'t reset caches when dns ↵Robert Greenwalt
props change." * commit 'fed3135972f9725a44a7d9b3df728e311ac1a130': Don't reset caches when dns props change.
2011-07-20Don't reset caches when dns props change.Mattias Falk
This happens too frequently. We should flush a per-interface cache when it's dns server addrs changes. Change-Id: I8a691c96ce9a775160ef55ddb8f755d649041583
2011-06-27am e0a4b678: am cc32fbc3: Merge "Add support for a dns cache per interface"Robert Greenwalt
* commit 'e0a4b67811981ab4c04c437b23c36ae42c444bce': Add support for a dns cache per interface
2011-06-08Add support for a dns cache per interfaceMattias Falk
Initial commit for dns cache per interface. Added a type that holds a reference to a cache and name of associated interface, address of interface, name server(s) associated with an interface etc. New functions to set default interface, address of name servers etc. Change-Id: Ie991bc5592fd998409853d8bf77d7fe69035dac5