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 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
This was misleading 'configure' into thinking we actually support AF_LINK,
but we're Linux, so we don't, and we never implemented the functions we
declared here either.
Reported to AOSP by Jun-ya Kato.
(cherry-pick of 5056f1fad1187cd67729bb04ba72397d78256f03.)
Change-Id: Ic67f674d2221497c8166994812bb5fc7f0831066
This was misleading 'configure' into thinking we actually support AF_LINK,
but we're Linux, so we don't, and we never implemented the functions we
declared here either.
Reported to AOSP by Jun-ya Kato.
Change-Id: I111f9887f3812469b411b9cf5124d9dd624f19f7
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
Update wire protocol to return and process error code first.
This will make sure dns proxy operations do not stall when
an internal error happens.
Also fix a compiler warning.
Also fix a potential buffer overflow.
And use correct types (uint32_t) rather than int when reading from network.
Change-Id: I9f99c16d6fd5e9137491a4d1b293a7c78e31b9c3
Prepend a 0 to match the new sequence-number style, though this module
doesn't really need/use it.
bug:5864209
Change-Id: Iacbcddaced6fe8bb01d186596a916e4fb4805fef
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
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
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
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
We can't easily tell the protocol family of the secondary network,
so try both and trust that the carrier has configured dns servers
according to the protocols supported on its network.
bug:5468224
Change-Id: If4f017573d313a6ad8354574076de6d63d43b444
AI_ADDRCONFIG is currently implemented by trying to connect
to well-known addresses in order to see if IPv4 and/or IPv6
connectivity is available.
In some cases (e.g., walled gardens with no global
connectivity) both probes can fail. If this happens,
query for both IPv4 and IPv6 addresses instead of doing
nothing and failing the query.
Bug: 5284168
Change-Id: I4e3a69ea86fb6d839a6bd31236b98da81e5cbf45
Change Ife82a8d8 broke IPv6 on wifi. Change I4e3a69ea is
an alternate approach that does not require any framework
changes.
Bug: 5284168
Change-Id: Ib52614be3875a2ae2eaedd1be265f90e506eda41
Instead of checking for IPv4 or IPv6 connectivity, try using pid-specific
hints the framework has left for us.
bug:5284168
Change-Id: Id64d48db3900865a7d58ada8309870c63d6eab12
This happens too frequently. We should flush a per-interface cache
when it's dns server addrs changes.
Change-Id: I8a691c96ce9a775160ef55ddb8f755d649041583
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
Make netinet/ip.h have IPTOS_MINCOST which matches what
kernel/common/linux/ip.h has to say.
Fixup gethostbyaddr() 1st arg to match what man has to say.
Change-Id: Iff9647d4a46ea88b1fc32163eb69bb9b27cdf370
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
Make netinet/ip.h have IPTOS_MINCOST which matches what
kernel/common/linux/ip.h has to say.
Fixup gethostbyaddr() 1st arg to match what man has to say.
Change-Id: Iff9647d4a46ea88b1fc32163eb69bb9b27cdf370
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
The gethostbyaddr code in system/netd now expects a string address
from inet_ntop, not raw bytes, in order to properly pass addresses
containing null and probably spaces and newlines characeters as well.
Bug: 4344448
Change-Id: I8ec0eab94d5b1d38e9269ba3afb2825e946f8df3
The gethostbyaddr code in system/netd now expects a string address
from inet_ntop, not raw bytes, in order to properly pass addresses
containing null and probably spaces and newlines characeters as well.
Bug: 4344448
git cherry-pick -e c13fa640ee
The gethostbyaddr code in system/netd now expects a string address
from inet_ntop, not raw bytes, in order to properly pass addresses
containing null and probably spaces and newlines characeters as well.
Bug: 4344448
Change-Id: I935abbbe522d96b64a5f975c7937e3aed3f7b335