summaryrefslogtreecommitdiff
path: root/libc/netbsd/resolv/res_init.c
AgeCommit message (Collapse)Author
2014-02-28Renamed the misleading libc/netbsd directory to libc/dns.Calin Juravle
Bug: 13219633 Change-Id: Ide43add0b90b3081cc709a22d1ff1f59d65f1104
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-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
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
2011-03-18libc: Fix leak in the DNS thread-specific state.David 'Digit' Turner
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
2010-10-15resolv: make internal symbols static/hiddenJim Huang
Change-Id: I988b83613e6252c0cc961555e81c10f856a38b37
2010-03-08Fix spurious DNS lookups in the C library.David 'Digit' Turner
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
2009-04-13Add the domain search list for VPN connection.Chung-yih Wang
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.
2009-03-03auto import from //depot/cupcake/@135843The Android Open Source Project
2009-03-03auto import from //depot/cupcake/@135843The Android Open Source Project
2008-10-21Initial ContributionThe Android Open Source Project