• Home
  • History
  • Annotate
  • only in /bionic/libc/netbsd/resolv/
History log of /bionic/libc/netbsd/resolv/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ce5ba8bfcd8ecfb7bfee4412f4f686cecc17e39b 20-Jun-2012 Henrik Engström <henrik.engstrom@sonymobile.com> Added missing cache failed notification

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
es_send.c
8f88aa7d3823ac079fc783651a64dbe986a8205e 13-Jun-2012 Robert Greenwalt <rgreenwalt@google.com> am c5cab345: am 028ccf5d: Merge "Avoid multiple dns lookups for the same query"

* commit 'c5cab3452d5ced55474e56497594579108670b51':
Avoid multiple dns lookups for the same query
c5cab3452d5ced55474e56497594579108670b51 13-Jun-2012 Robert Greenwalt <rgreenwalt@google.com> am 028ccf5d: Merge "Avoid multiple dns lookups for the same query"

* commit '028ccf5d40dd9a945ea92aa79822c08c6f6aa1d2':
Avoid multiple dns lookups for the same query
524c87c61c1d39dd60aaa8ae01ec3528ce212288 09-Jun-2012 Geremy Condra <gcondra@google.com> Added event logging for some spoofed DNS queries.

Change-Id: I40909306e8cf922f1dd5a5685db89f732a709794
es_send.c
5a095ef28716b54f86d9c1727b9a2493ba775255 30-May-2012 Geremy Condra <gcondra@google.com> am 03539a36: Merge "Ensure that the port number and TXID are properly randomized." into jb-dev

* commit '03539a36b634bdfa61c06277cf25e0ca8e3105ba':
Ensure that the port number and TXID are properly randomized.
b23f193dcc0fa74b5be1978f85cc1c6811493c86 21-May-2012 Geremy Condra <gcondra@google.com> Ensure that the port number and TXID are properly randomized.

This fix reads from /dev/urandom to get the required entropy.

Bug: 6535492
Change-Id: Ibc2fec3f71a67607b608ad9b767b0b6504993c1d
es_init.c
a59cfcfd0821f51ee77f13105099f700ccbf9252 06-Sep-2011 Mattias Falk <mattias.falk@sonyericsson.com> Avoid multiple dns lookups for the same query

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
es_cache.c
es_send.c
53daf4757d36522c132006e2f74ed81bb4ed717a 07-May-2012 Elliott Hughes <enh@google.com> am 73a6566d: Merge "Remove expired dns cache entries before removing oldest"

* commit '73a6566da337db50cfc73c369d774ac1905a30c2':
Remove expired dns cache entries before removing oldest
73a6566da337db50cfc73c369d774ac1905a30c2 07-May-2012 Elliott Hughes <enh@google.com> Merge "Remove expired dns cache entries before removing oldest"
52764f5546362d0ffab99afaffe8e8c7f21f8ef2 26-Jan-2012 Robert Greenwalt <rgreenwalt@google.com> Increase the size of the system-wide dns cache

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
es_cache.c
79fcc6948d139878b9ae0423c2fe804636433ad8 19-Jan-2012 David 'Digit' Turner <digit@google.com> Merge "libc: remove private declarations from <time.h> and <resolv.h>"
b00d7a331c9f2a578a4cfc4dfe0d626aa58fa702 18-Jan-2012 Jean-Baptiste Queru <jbq@google.com> am eae1f1fb: Merge "res_send: Avoid spurious close()s and (rare) failure"

* commit 'eae1f1fba33cb105302227b044a14e5abcbe55e7':
res_send: Avoid spurious close()s and (rare) failure
87043f9c89593125a27199d0c1b4069d088672d7 12-Dec-2011 Jim Huang <jserv@0xlab.org> res_send: Avoid spurious close()s and (rare) failure

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
es_send.c
208898ee776117f42815c2fcb15903b2781bf0aa 13-Jan-2012 David 'Digit' Turner <digit@google.com> libc: remove private declarations from <time.h> and <resolv.h>

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
es_cache.c
ecd0e95a0276c1ba72c7331f5e4617815f015f22 11-Jan-2012 Robert Greenwalt <rgreenwalt@google.com> Adding a timeout to tcp dns lookup connects.

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
es_send.c
7f84da69f86ed9daf610c8d1129392ba3f7c4405 02-Sep-2011 Robert Greenwalt <rgreenwalt@google.com> Add some logging of dns cache operations

Added info about what entries are getting flushed due to ttl or size limits.

Change-Id: I69fb70ce23b5b820f5f1a5738c0f1aa57b6a1127
es_cache.c
777901424fa1100817f80a8cff8330b4b11d5af7 27-Jul-2011 Robert Greenwalt <rgreenwalt@google.com> resolved conflicts for merge of 9363d912 to honeycomb-plus-aosp

Change-Id: I555f5c10da9770feacdbece9fd77729d6151bfba
9363d91218c7ed727c36ffaf82ff28d7755375ae 25-Jul-2011 Robert Greenwalt <rgreenwalt@google.com> Add per-interface dns caches.

import of changes 22100 and 23138 from opensource.

Change-Id: I3ce86394323d269272aeb2bebeed4374f171a8cf
es_cache.c
es_state.c
e4197d41bb3458ea3a38de7bd75aa9cab27ee3af 21-Jul-2011 Robert Greenwalt <rgreenwalt@google.com> am fed31359: am f6fcdb2e: am 28de3e59: Merge "Don\'t reset caches when dns props change."

* commit 'fed3135972f9725a44a7d9b3df728e311ac1a130':
Don't reset caches when dns props change.
bad1686e1fadea28b56c83268b95c089671c9a89 04-Apr-2011 Mattias Falk <mattias.falk@sonyericsson.com> Don't reset caches when dns props change.

This happens too frequently. We should flush a per-interface cache
when it's dns server addrs changes.

Change-Id: I8a691c96ce9a775160ef55ddb8f755d649041583
es_state.c
8f88cbedc1692def20298300a7df94ad1c536259 27-Jun-2011 Robert Greenwalt <rgreenwalt@google.com> am e0a4b678: am cc32fbc3: Merge "Add support for a dns cache per interface"

* commit 'e0a4b67811981ab4c04c437b23c36ae42c444bce':
Add support for a dns cache per interface
23d3e6b21b4b6debff87da8c6558495e564cc38e 04-Apr-2011 Mattias Falk <mattias.falk@sonyericsson.com> Add support for a dns cache per interface

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
es_cache.c
dd16182b4b3f107d5c26015622c1cb8c06619ad7 20-May-2011 Anders Fredlund <anders.fredlund@sonyericsson.com> Remove expired dns cache entries before removing oldest

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
es_cache.c
b6cd6816d2145682aecb64a676bd3df32185a0e2 17-Mar-2011 David 'Digit' Turner <digit@google.com> libc: Fix leak in the DNS thread-specific state.

NOTE: This is a back-port from the internal HC branch.

This patch fixes a leak that occurs when creating a new
thread-specific DNS resolver state object.

Essentially, each thread that calls gethostbyname() or getaddrinfo()
at least once will leak a small memory block. Another leak happens
anytime these functions are called after a change of the network
settings.

The leak is insignificant and hard to notice on typical programs.
However, netd tends to create one new thread for each DNS request
it processes, and quickly grows in size after a > 20 hours.

The same problem is seen in other system processes that tend to
create one thread per request too.

The leak occured becasue res_ninit() was called twice when creating
a new thread-specific DNS resolver state in _res_get_thread().

This function could not properly reset an existing thread and was
leaking a memory block.

The patch does two things:

- First, it fixes res_ninit() to prevent any leakage when resetting
the state of a given res_state instance.

- Second, it modifies the _res_get_thread() implementation to
make it more explicit, and avoid calling res_ninit() twice
in a row on first-time creation.

Fix for Bug 4089945, and Bug 4090857

Change-Id: Icde1d4d1dfb9383efdbf38d0658ba915be77942e
es_init.c
es_state.c
a34694d39498975c3afae959a7a52f1ea7092888 12-Apr-2011 Brad Fitzpatrick <bradfitz@android.com> am 09db590d: am 9b6e8af6: am 3ef36b21: Merge "Use system property to set dns cache size"

* commit '09db590d56ff2b568ea1a0ce265810697f0e0e92':
Use system property to set dns cache size
09db590d56ff2b568ea1a0ce265810697f0e0e92 12-Apr-2011 Brad Fitzpatrick <bradfitz@android.com> am 9b6e8af6: am 3ef36b21: Merge "Use system property to set dns cache size"

* commit '9b6e8af6994fd41f468161dec797354bb7778673':
Use system property to set dns cache size
02be15039a79735286ca8f10074aaa9b2d61a56b 25-Mar-2011 David 'Digit' Turner <digit@google.com> am aa8f50b4: am 6d46b099: am 2f169162: Merge "libc: Fix leak in the DNS thread-specific state." into honeycomb-mr1

* commit 'aa8f50b404ab0b2c78833387551800fa8448afcd':
libc: Fix leak in the DNS thread-specific state.
2cc2b2be692f1d559a09d2066e56e450249cc9c0 22-Mar-2011 Carl Shapiro <cshapiro@google.com> Add some missing includes.

Change-Id: Ieec623c06bc32ec78334f628af25b00c2bccd2e7
es_debug.c
4661fda2e5339c39ceb3aefd184eb8be3d0ca835 17-Mar-2011 David 'Digit' Turner <digit@google.com> libc: Fix leak in the DNS thread-specific state.

This patch fixes a leak that occurs when creating a new
thread-specific DNS resolver state object.

Essentially, each thread that calls gethostbyname() or getaddrinfo()
at least once will leak a small memory block. Another leak happens
anytime these functions are called after a change of the network
settings.

The leak is insignificant and hard to notice on typical programs.
However, netd tends to create one new thread for each DNS request
it processes, and quickly grows in size after a > 20 hours.

The same problem is seen in other system processes that tend to
create one thread per request too.

The leak occured becasue res_ninit() was called twice when creating
a new thread-specific DNS resolver state in _res_get_thread().

This function could not properly reset an existing thread and was
leaking a memory block.

The patch does two things:

- First, it fixes res_ninit() to prevent any leakage when resetting
the state of a given res_state instance.

- Second, it modifies the _res_get_thread() implementation to
make it more explicit, and avoid calling res_ninit() twice
in a row on first-time creation.

Fix for Bug 4089945, and Bug 4090857

Change-Id: Ie4831a8dbe82be8f07fce5ddd1d36bf95994f836
es_init.c
es_state.c
3a4910c6161d57e40ba01cc9693f1a4514892b03 14-Feb-2011 Mattias Falk <mattias.falk@sonyericsson.com> Use system property to set dns cache size

Use system property ro.net.dns_cache_size to set
the size of the cache. If the system property
is not set the default cache size is defined by
CONFIG_MAX_ENTRIES.

The number of entries in the hash table will be equal
to the number of max entries allowed in the cache.

Change-Id: I77d69d7c178937fa483d0b40512483ad29232d28
es_cache.c
3e0c5102e6d57e5b7296f95e1b318fda6114b48e 31-Jan-2011 Mattias Falk <mattias.falk@sonyericsson.com> Add time-to-live (TTL) support to resolver cache

Use the the TTL of the answer as the time a query
shall remain in the resolver cache.

Added some debugging support as well, i.e.
parse answer and print a la dig.

Change-Id: I724d3392245032592f1912f3ca7a81a8987ebbac
es_cache.c
7cc5666d94615d9249163dc7ac0f58c2614497ce 14-Oct-2010 Jim Huang <jserv@0xlab.org> resolv: make internal symbols static/hidden

Change-Id: I988b83613e6252c0cc961555e81c10f856a38b37
es_cache.c
es_data.c
es_debug.c
es_init.c
es_send.c
es_state.c
d378c68d74cb4fdac450650fe816c9d649c8edaf 09-Mar-2010 David 'Digit' Turner <digit@google.com> Fix spurious DNS lookups in the C library.

The problem was that the 'defdname' field of res_state structure
was not properly initialized in __res_vinit(). This field is used
to store the default domain name, which is normally build from
calling gethostname() (see line 549 of res_init.c).

Unfortunately, in the typical Android case, gethostname() returns
an error (the hostname is configured) and a random stack string is
used later to build the DNS search list (see lines 556+ in res_init.c)

For the sake of illustration, let's say the search list is set to
a random value like 'xWLK'.

The end result is that when trying to result an unknown domain name
(e.g. 'www.ptn'), the query fails then the resolver tries to make a
new query with the DNS search list path(s) appended (e.g. 'www.ptn.xWLK').

The patch simply initializes 'defdname' to an empty string to avoid
this when the net.dns.search system property is not set.

Also contains whitespace/formatting fixes
es_cache.c
es_init.c
9cfb12e6bce65b49fd858b86149858ff3851072d 29-Jul-2009 David 'Digit' Turner <digit@google.com> am 3773d35e: Make the DNS resolver accept domain names with an underscore.

Merge commit '3773d35eb98e22b5edab4d82fb72bdf86ff80494'

* commit '3773d35eb98e22b5edab4d82fb72bdf86ff80494':
Make the DNS resolver accept domain names with an underscore.
3773d35eb98e22b5edab4d82fb72bdf86ff80494 27-Jul-2009 David 'Digit' Turner <digit@google.com> Make the DNS resolver accept domain names with an underscore.

More precisely, this accepts domain labels with an underscore in
the middle (i.e. not at the start or the end of the label). This
is needed to perform complex CNAME chain resolution in certain
VPN networks.
es_comp.c
c52c174e412fa6c829cf6353ce8dbebdf710511f 12-Jun-2009 Lorenzo Colitti <lorenzo@google.com> Make IPv6 definitions comply with RFC 3493:
- Add some definitions to netinet/in6.h
- Include netinet/in6.h from netinet/in.h
es_send.c
aeae1f5b6c6cf22c2854e07f11555591c5430607 09-Apr-2009 Chung-yih Wang <cywang@google.com> Add the domain search list for VPN connection.
The current solution is to read the net.dns.search property,
and expand the list during the resolve initialization. In the
future, we could implement search list per process.

Update: refine the code accordingly.

Update: remove unnecessary code.

Update: remove the unused variable.
es_init.c
1dc9e472e19acfe6dc7f41e429236e7eef7ceda1 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
_dn_comp.c
_res_close.c
_res_send.c
error.c
es_cache.c
es_comp.c
es_compat.c
es_data.c
es_debug.c
es_debug.h
es_init.c
es_mkquery.c
es_private.h
es_query.c
es_random.c
es_send.c
es_state.c
1767f908af327fa388b1c66883760ad851267013 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
_dn_comp.c
_res_close.c
_res_send.c
error.c
es_cache.c
es_comp.c
es_compat.c
es_data.c
es_debug.c
es_debug.h
es_init.c
es_mkquery.c
es_private.h
es_query.c
es_random.c
es_send.c
es_state.c
6f04a0f4c72acff80dad04828cb69ef67fa609d1 19-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@132276
es_cache.c
es_send.c
es_state.c
a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
_dn_comp.c
_res_close.c
_res_send.c
error.c
es_cache.c
es_comp.c
es_compat.c
es_data.c
es_debug.c
es_debug.h
es_init.c
es_mkquery.c
es_private.h
es_query.c
es_random.c
es_send.c
es_state.c