Some DNS servers intentionally "misuse" the obsoleted CHAOS (CH) qclass to provide things like `version.bind`, `version.server`, `authors.bind`, `hostname.bind` and `id.server`.
C-ares was not allowing such use cases.
Fix By: Teemu R. (@rytilahti)
OSS-Fuzz has reported a double-free with the fuzzer input file
included here; run with:
./test/aresfuzz test/fuzzinput/clusterfuzz-5637790584012800
Bisecting the failure points to commit e0517f97d9 ("Parse SOA records
from ns_t_any response (#103)")
Tests require linking against the static library on Windows otherwise the symbols are not exported for internals being tested.
Fix By: Brad House (@bradh352)
Replace usage of inet_addr() with ares_inet_pton() which is more appropriate and fixes issues with legitimate addresses like 255.255.255.0. IPv6 already used this.
Fixes#309
Fix By: Brad House (@bradh352)
Build and Install PDB (Windows Debug Symbol) files if supported by underlying system.
Also update AppVeyor to test cmake builds.
Fixes#245
Fix By: Piotr Pietraszkiewicz (@ppietrasa) and Brad House (@bradh352)
CHECK_LIBRARY_EXISTS(), while it takes a function name, does not actually verify the function exists in the library being evaluated. Instead, if the function is found in any dependent library, and the referenced library also exists, it returns true. This is not desirable.
Wrap with a Macro to change the behavior.
Fixes: #307
Fix By: Brad House (@bradh352)
Added the capability of parsing SOA record from a response buffer of ns_t_any type query, this implementation doesn't interfere with existing T_SOA query's response as that too is treated as a list of records. The function returns ARES_EBADRESP if no SOA record is found(as per RFC).
The basic idea of sticking to RFC that a ns_t_any too should return an SOA record is something open for discussion but I have kept the functionality intact as it was previously i.e the function returns ARES_EBADRESP if it doesn't find a SOA record regardless of which response it is parsing i.e. T_SOA or T_ANY.
Note that asking for T_ANY is generally a bad idea:
- https://blog.cloudflare.com/what-happened-next-the-deprecation-of-any/
- https://tools.ietf.org/html/draft-ietf-dnsop-refuse-any
Bug: #102
Fix By: Dron Rathore (@DronRathore)
Added CPack functionality for generating RPM or DEB packages
ie: run `cpack -G RPM` (or "DEB") after building with CMake.
The current configuration creates 3 separate packages for the shared library,
the development files and the tools.
Fix By: Stephen Bryant (@bf-bryants)
ares_gethostbyname() was returning ESUCCESS when no A or AAAA record was found but a CNAME pointing nowhere was present. ENODATA should be returned instead, however the hosts pointer will still be present to provide the alias list.
* Return ENODATA if no valid A or AAAA record found
* Fix and update test ParseAReplyNoData.
* Add test for new ENODATA behaviour in ares_gethostbyname.
Fixes Bug #303
Fix By: @tjwalton
Before this change, SetServers, SetServersPorts and SetServersCSV
contained test cases trying to make DNS queries with the google.com
hostname, which requires Internet connectivity. Tests with that
requirement should be defined in the ares-test-live.cc file and contain
"Live" prefix to filter them out with `--gtest_filter=-*.Live*` on
machines without Internet connectivity.
Fix By: Michal Rostecki (@mrostecki)
When ares_parse_a_reply or ares_parse_aaaa_reply is called in case
where another AAAA and A responses exist, the resulting ares_addrttl
count is invalid and the structure points to gibberish.
This is a regression since 1.15.
Issue: https://github.com/c-ares/c-ares/issues/300
Fix By: Adam Majer (@AdamMajer)
* Add CARES_BUILD_CONTAINER_TESTS CMake option to add ability to build the Linux-only containerized tests.
* Accept invalid /etc/resolv.conf lookup values
Before this commit invalid `lookup` values resulted in c-ares not using
any lookups without any clear indication why. After this commit it uses
the default "fb".
Fix By: Ben Noordhuis (@bnoordhuis)
A and AAAA lookups for ares_getaddrinfo() are now performed in parallel.
For this change `ares_search` was removed from `ares_getaddrinfo`.
Instead `ares_query` in combination with `next_dns_lookup` are
doing the suffix search.
Adding support for `.onion` addresses which are tested by
`TEST_F(DefaultChannelTest, GetAddrinfoOnionDomain)`
Fix By: Christian Ammer (@ChristianAmmer)
7e6af8e inserted the documentation of resolvconf_path in the middle of
the item for ednspsz, leading to broken layout. Fix that.
Fix By: Peter Eisentraut (@petere)
The const AddrInfo& argument to operator<< overload for AddrInfo can be
a nullptr unique_ptr. Handle this explicitly by printing {nullptr} if
the rest of the function cannot be safely executed.
Fix-by: Dan Noé <dpn@google.com>
This files references INT_MAX, but does not include limits.h. This can
cause a build failure on some platforms. Include limits.h if we have it.
Fix-by: Dan Noé <dpn@google.com>
* fix leak if naddress of particular type found
* fix segfault when wanted ttls count lesser than count of result records
* add fuzzer input files that trigger problems (from #263)
Reported-By: David Drysdale (@daviddrysdale)
Fix-By: Andrew Selivanov (@ki11roy)
* Service support has been added to getaddrinfo.
* ares_parse_a/aaaa_record now share code with the addrinfo parser.
* Private ares_addrinfo structure with useful extensions such as ttls (including cname ttls),
as well as the ability to list multiple cnames in chain of lookups
Work By: Andrew Selivanov @ki11roy
Some socket functions weren't exposed for use by other areas of the library. Expose
those and make use of them in ares__sortaddrinfo().
Fix By: Andrew Selivanov (@ki11roy)
Due to an order of incrementing the remaining queries and calling ares_query, on a bad domain
the registered callback wouldn't be called.
Bug: #248
Fixed-By: @kedixa
Fix link issues caused by missing library that appears to only be required on ARM (though
docs don't list this restriction). Doesn't hurt to require it everywhere.
Bug: #251
Fixed-By: Darrin Cullop (@dwcullop)
There are two possible causes for infinite loops fo NXDOMAIN, based on how many dots are in the domain name (one for < ARES_OPT_NDOTS and one for >= ARES_OPT_NDOTS), where it will repeat the same query over and over as the hquery->next_domain doesn't increment.
Fix By: @kedixa
When querying a .onion domain, it returns directly without setting bufp to NULL. A subsequent free() that occurs can cause a segmentation fault.
Fix By: Khaidi Chu (@XadillaX)
This is a port of RFC 6724 compliant sorting function from Android Bionic project:
e919b116d3/libc/netbsd/net/getaddrinfo.c
The latest version is essentially the same, except two additional parameters to test connection with (mark/uid):
https://android.googlesource.com/platform/bionic/+/master/libc/dns/net/getaddrinfo.c
Please note that even that version has some restrictions. It doesn't support some rules from RFC 6724:
Rule 3 (Avoid deprecated addresses)
Rule 4 (Prefer home addresses)
Rule 7 (Prefer native transport)
Submitted By: Andrew Selivanov (@ki11roy)
* using portable ares_inet_pton and updated includes in ares-test-mock-ai
* forgot to remove deleted ares-test-ai.cc in Makefile.inc
Fix By: Christian Ammer (@ChristianAmmer)