./net/libcares, Asynchronous resolver library, c-ares

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 1.34.1nb1, Package name: libcares-1.34.1nb1, Maintainer: pkgsrc-users

c-ares is a C library that performs DNS requests and name resolves
asynchronously.

c-ares is a fork of the library named 'ares', written by Greg Hudson at MIT.
The fork was made on ares 1.1.1.


Required to build:
[pkgtools/cwrappers]

Master sites:

Filesize: 984.594 KB

Version history: (Expand)


CVS history: (Expand)


   2024-04-14 10:15:59 by Thomas Klausner | Files touched by this commit (1)
Log message:
libcares: fix pkg-config file

Bump PKGREVISION.
   2024-04-05 13:17:03 by Thomas Klausner | Files touched by this commit (3) | Package updated
Log message:
libcares: update to 1.28.1.

c-ares version 1.28.1 - Mar 30 2024

This release contains a fix for a single significant regression introduced in \ 
c-ares 1.28.0.

    ares_search() and ares_getaddrinfo() resolution fails if no search domains \ 
are specified. Issue #737

c-ares version 1.28.0 - Mar 29 2024

This is a feature and bugfix release.

Features:

    Emit warnings when deprecated c-ares functions are used. This can be \ 
disabled by passing a compiler definition of CARES_NO_DEPRECATED. PR #732
    Add function ares_search_dnsrec() to search for records using the new DNS \ 
record data structures. PR #719
    Rework internals to pass around ares_dns_record_t instead of binary data, \ 
this introduces new public functions of ares_query_dnsrec() and \ 
ares_send_dnsrec(). PR #730

Changes:

    tests: when performing simulated queries, reduce timeouts to make tests run \ 
faster
    Replace configuration file parsers with memory-safe parser. PR #725
    Remove acountry completely, the manpage might still get installed otherwise. \ 
Issue #718

Bugfixes:

    CMake: don't overwrite global required libraries/definitions/includes which \ 
could cause build errors for projects chain building c-ares. Issue #729
    On some platforms, netinet6/in6.h is not included by netinet/in.h and needs \ 
to be included separately. PR #728
    Fix a potential memory leak in ares_init(). Issue #724
    Some platforms don't have the isascii() function. Implement as a macro. PR #721
    CMake: Fix Chain building if CMAKE runtime paths not set
    NDots configuration should allow a value of zero. PR #735
   2024-02-23 13:58:34 by Thomas Klausner | Files touched by this commit (3) | Package updated
Log message:
libcares: update to 1.27.0.

This is a security, feature, and bugfix release.

Security:

    Moderate. CVE-2024-25629. Reading malformatted /etc/resolv.conf,
    /etc/nsswitch.conf or the HOSTALIASES file could result in a
    crash. GHSA-mg26-v6qh-x48q

Features:

    New function ares_queue_active_queries() to retrieve number of
    in-flight queries. PR #712
    New function ares_queue_wait_empty() to wait for the number of
    in-flight queries to reach zero. PR #710
    New ARES_FLAG_NO_DEFLT_SVR for ares_init_options() to return
    a failure if no DNS servers can be found rather than attempting
    to use 127.0.0.1. This also introduces a new ares status code
    of ARES_ENOSERVER. PR #713

Changes:

    EDNS Packet size should be 1232 as per DNS Flag Day. PR #705

Bugfixes:

    Windows DNS suffix search list memory leak. PR #711
    Fix warning due to ignoring return code of write(). PR #709
    CMake: don't override target output locations if not top-level. Issue #708
    Fix building c-ares without thread support. PR #700
   2024-01-28 14:02:12 by Thomas Klausner | Files touched by this commit (3) | Package updated
Log message:
libcares: update to 1.26.0.

## c-ares version 1.26.0 - Jan 26 2024

Features:

* Event Thread support.  Integrators are no longer requried to monitor the
  file descriptors registered by c-ares for events and call `ares_process()`
  when enabling the event thread feature via `ARES_OPT_EVENT_THREAD` passed
  to `ares_init_options()`. [PR #696](https://github.com/c-ares/c-ares/pull/696)
* Added flags to `are_dns_parse()` to force RAW packet parsing.
  [PR #693](https://github.com/c-ares/c-ares/pull/693)

Changes:

* Mark `ares_fds()` as deprected.
  [PR #691](https://github.com/c-ares/c-ares/pull/691)

Bugfixes:

* `adig`: Differentiate between internal and server errors.
  [e10b16a](https://github.com/c-ares/c-ares/commit/e10b16a)
* Autotools allow make to override CFLAGS/CPPFLAGS/CXXFLAGS.
  [PR #695](https://github.com/c-ares/c-ares/pull/695)
* Autotools: fix building for 32bit windows due to stdcall symbol mangling.
  [PR #689](https://github.com/c-ares/c-ares/pull/689)
* RR Name should not be sanity checked against the Question.
  [PR #685](https://github.com/c-ares/c-ares/pull/685)
   2024-01-07 17:05:32 by Thomas Klausner | Files touched by this commit (3) | Package updated
Log message:
libcares: update to 1.25.0.

Version 1.25.0 (2 Jan 2024)

GitHub (2 Jan 2024)
- [Brad House brought this change]

  1.25.0 release prep (#676)

Brad House (31 Dec 2023)
- tests: replace google DNS with CloudFlare for reverse lookups as google's \ 
servers stopped responding properly

- OSSFuzz: it assumes autotools builds a static library by default, which means \ 
the old autotools must have done that even though there were comments saying it \ 
wasn't.  Disable static by default on Windows however since it can't build both \ 
simultaneously.

- autotools: update logic for building tests to provide more feedback

- set winver consistently across build systems

GitHub (28 Dec 2023)
- [Brad House brought this change]

  Autotools: rework to simplify and fix recent issues (#674)

  Completely rework the autotools build system, issues have cropped up due to \ 
the complexity and could cause issues on even semi-modern Linux systems (Ubuntu \ 
20.04 for example).

  Changes include:

  Remove all curl/xc/cares m4 helper files, they go overboard on detections of \ 
functions and datatypes. Go back to more plain autoconf macros as they've come a \ 
long way over the years.
  Use known systems and heuristics to determine datatypes for functions like \ 
send() and recv(), rather than the error prone detection which required \ 
thousands of permutations and might still get it wrong.
  Remove unneeded configure arguments like --enable-debug or --enable-optimize, \ 
its more common for people to simply pass their own CFLAGS on the command line.
  Only require CARES_STATICLIB definition on Windows static builds, its not \ 
necessary ever for other systems, even when hiding non-public symbols.
  Remove some function and definition detections that were never used in c-ares
  The test framework is now embedded into the toplevel configure system, there \ 
was no need to chain build the test system as it is never built externally to \ 
c-ares.
  As a side-effect of the changes, a configure run completes in about 25% of the \ 
original time.

  This has been tested on various Linux distributions (of varying age), FreeBSD, \ 
MacOS, Windows (via MSYS2 with Mingw), and Solaris10/11 (by @dfandrich), AIX 7.3 \ 
(by @dfandrich). It is not unlikely that this may have broken more esoteric or \ 
legacy systems, and we'll likely need to be ready to accept bug reports and \ 
patches, but it has removed over 10k lines of build system code. It is very \ 
likely any issues that crop up will add far fewer lines of code to fix such \ 
systems.

  Fixes Bug: #670
  Fix By: Brad House (@bradh352)

Brad House (22 Dec 2023)
- docs: host -> ip

  fix mismatched documentation stating host instead of ip

  Fix By: Brad House (@bradh352)

GitHub (21 Dec 2023)
- [Brad House brought this change]

  Old MacOS SDKs require you include sys/socket.h before net/if.h (#673)

  Old MacOS SDKs (like 10.8) require you include `sys/socket.h` before you \ 
include `net/if.h` as reported by MacPorts.  Using a new SDK but with setting \ 
the macos target version does not have the same issue.

  Fixes Issue: #672
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  Autotools warning fixes (#671)

  * get rid of clashes with curl namespace
  * remove warnings due to deprecated functionality
  * reorder some macro calls to get rid of warnings due to being called in the \ 
wrong order

  Fix By: Brad House (@bradh352)

Brad House (19 Dec 2023)
- clang-format

- ares_strsplit() rewrite as wrapper around ares__buf_split()

  We want to limit as much as possible any hand written parsers.
  ares__buf_split() uses the new memory-safe parsing routines.  This
  adds a couple of additional flags to remove duplicates which the
  existing split code did.

  Fix By: Brad House (@bradh352)

- clang-format

- sonarcloud: const

- Connection failure should increment server failure count first

  In order to be sure a different server is chosen on the next query,
  a read error should result in the failure count being updated
  first before requeing the request to a different server.

  Fix By: Brad House (@bradh352)

GitHub (18 Dec 2023)
- [Brad House brought this change]

  ahost should use ares_getaddrinfo() these days (#669)

  ahost wasn't printing both ipv4 and ipv6 addresses. This day and age, it \ 
really should.

  This PR also adds the ability to specify the servers to use.

  Fix By: Brad House (@bradh352)

Brad House (17 Dec 2023)
- Fix bad stub for ares__iface_ips_enumerate()

  If the ability to enumerate interface ip addresses does not exist
  on a system, the stub function contained the wrong prototype.

  Fixes Bug: #668
  Fix By: Brad House (@bradh352)

GitHub (17 Dec 2023)
- [Gregor Jasny brought this change]

  Fix minor warnings and documentation typos (#666)

  Build warnings could be seen \ 
[here](https://buildd.debian.org/status/fetch.php?pkg=c-ares&arch=arm64&ver=1.24.0-1&stamp=1702826366&raw=0) \ 
[origin](https://buildd.debian.org/status/package.php?p=c-ares)

  Fix By: Gregor Jasny (@gjasny)

- [Brad House brought this change]

  CI: Add Alpine Linux and old Ubuntu (#667)

  Alpine linux doesn't use glibc but instead musl c, so provides a good \ 
alternative test bed. We are also adding the oldest non-EOL ubuntu version so we \ 
can test against older linux variants to prevent surprises.

  This patch also migrates more tests to use cmake and ninja in order to reduce \ 
overall build times as we seem to run out of credits on Cirrus-CI pretty \ 
quickly.

  Fix By: Brad House (@bradh352)

Brad House (17 Dec 2023)
- fix support with older google test versions

- getrandom() may require sys/random.h on some systems

  There is a reported build issue where getrandom() is detected
  but compile fails due to a missing prototype. This commit attempts
  to resolve that issue.

  Fixes Bug: #665
  Fix By: Brad House (@bradh352)

GitHub (17 Dec 2023)
- [Martin Chang brought this change]

  Use SOCK_DNS extension on socket on OpenBSD (#659)

  This patch added the `SOCK_DNS` flag when running on OpenBSD. Allowing a \ 
reduced set of `pledge(2)` promises. Before this patch. The "stdio rpath \ 
inet" promises must be used in order to resolve any records. After the \ 
patch inet can be replaced with dns which only allows communication on \ 
destination port 53, instead of on all ports.

  Side note: I checked the OpenBSD kernel source code. Even though the socket \ 
document says the DNS port (typically 53)., The OpenBSD 7.4 kernel only allows \ 
53.

  Fix By: Martin Chang (@marty1885)

Brad House (17 Dec 2023)
- ci: disable static for symbol hiding tests

- ci: add test case for building with hidden symbol visibility

- fix test building with symbol hiding

  New test cases depend on internal symbols for calculating timeouts.
  Disable those test features if symbol hiding is enabled.

  Fixes Bug: #664
  Fix By: Brad House (@bradh352)
   2023-12-30 11:14:00 by Thomas Klausner | Files touched by this commit (3) | Package updated
Log message:
libcares: update to 1.24.0.

Version 1.24.0 (16 Dec 2023)

GitHub (16 Dec 2023)
- [Brad House brought this change]

  ares_cancel() could trigger callback with wrong response code (#663)

  When doing ares_gethostbyname() or ares_getaddrinfo() with AF_UNSPEC, if \ 
ares_cancel() was called after one address class was returned but before the \ 
other address class, it would return ARES_SUCCESS rather than ARES_ECANCELLED.

  Test case has been added for this specific condition.

  Fixes Bug: #662
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  rand: allow fallback from OS (#661)

  getrandom() can fail with ENOSYS if the libc supports the function but the \ 
kernel does not.

  Fixes Bug: #660
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  1.24.0 release prep (#657)

Brad House (11 Dec 2023)
- reference alternative to ares_getsock() in docs

- tag some functions as deprecated in docs

- Coverity: fix allocation size as reported in new code

- remove dead code: ares_iphlpapi.h

- remove dead code: bitncmp

GitHub (9 Dec 2023)
- [Brad House brought this change]

  Use external GoogleTest instead of bundling it (#655)

  GoogleTest should be unbundled. Google changed their guidance a few years back \ 
and modern versions of google test cannot build the bundling code file.

  This PR also updates to use C++14 as is required by modern GoogleTest versions.

  Fixes Bug: #506
  Fix By: Brad House (@bradh352)

Brad House (8 Dec 2023)
- use IF_NAMESIZE instead of IFNAMSIZ to avoid warning

- remove redundant cast

- clang-format and fix one warning

GitHub (8 Dec 2023)
- [Brad House brought this change]

  Clean up some Windows-only warnings (#654)

  Windows was emitting some warnings due to datatype differences.

  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  Rewrite sortlist hand parser for memory safety and bugs (#653)

  The parser for the sortlist has been rewritten to use the ares__buf_*() \ 
functions. This also resolves some known bugs in accepting invalid sortlist \ 
entries which should have caused parse failures.

  Fixes Bug: #501
  Fix By: Brad House (@bradh352)

Brad House (8 Dec 2023)
- enhance timeout test case to make sure it will re-use a previously downed server

- enhance timeout test case

- SonarCloud: make const

GitHub (7 Dec 2023)
- [Brad House brought this change]

  increment failures on timeout (#651)

  As of c-ares 1.22.0, server timeouts were erroneously not incrementing server \ 
failures meaning the server in use wouldn't rotate.  There was apparently never \ 
a test case for this condition.

  This PR fixes the bug and adds a test case to ensure it behaves properly.

  Fixes Bug: #650
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  Windows UBSAN tests (#649)

  Fix UBSAN error, and enable UBSAN testing in AppVeyor.

  Fixes Bug #648
  Fix By: Gisle Vanem (@gvanem)

- [Brad House brought this change]

  Support ipv6 link-local servers and %iface syntax (#646)

  Some environments may send router advertisements on a link setting their \ 
link-local (fe80::/10) address as a valid DNS server to the remote system.  This \ 
will cause a DNS entry to be created like `fe80::1%iface`, since all link-local \ 
network interfaces are technically part of the same /10 subnet, it must be told \ 
what interface to send packets through explicitly if there are multiple physical \ 
interfaces.

  This PR adds support for the %iface modifier when setting DNS servers via \ 
`/etc/resolv.conf` as well as via `ares_set_servers_csv()`.

  For MacOS and iOS it is assumed that libresolve will set the `sin6_scope_id` \ 
and should be supported, but my test systems don't seem to read the Router \ 
Advertisement for RDNSS link-local.  Specifying the link-local dns server on \ 
MacOS via adig has been tested and confirmed working.

  For Windows, this is similar to MacOS in that the system doesn't seem to honor \ 
the RDNSS RA, but specifying manually has been tested to work.

  At this point, Android support does not exist.

  Fixes Bug #462
  Supersedes PR #463

  Fix By: Brad House (@bradh352) and Serhii Purik (@sergvpurik)

Brad House (4 Dec 2023)
- silence openwatcom warning due to qcache_max_ttl being unsigned

- ares__round_up_pow2() work around bogus warning

  On 32bit systems, a codeblock that would intentionally never
  be executed was emitting a warning.  Rework the code to
  prevent the warning.  More code, no behavior difference, but
  keeps people from complaining about the warning...

  Fixes Bug: #645
  Fix By: Brad House (@bradh352)

- try to move AC_USE_SYSTEM_EXTENSIONS

- Enable system extensions

  Certain defines are needed on some systems to enable functionality like
  pthread recursive mutexes.

  Fixes #644
  Fix By: Brad House (@bradh352)

- ares_init_options() with invalid options values should unset the option

  Apparently nodejs is relying on the above behavior for legacy reasons.  Add
  sanity checks to the various optmask parameters where it makes sense.

  See https://github.com/nodejs/node/pull/50800

  Fix By: Brad House (@bradh352)

- SonarCloud: silence bogus reported error

- clang-format

GitHub (2 Dec 2023)
- [Brad House brought this change]

  Nameserver parsing: replace another hand-written parser (#643)

  This replaces the nameserver parsing code with code that use ares__buf_*() in \ 
the name of memory safety.

  Fix By: Brad House (@bradh352)
   2023-12-07 10:05:19 by Thomas Klausner | Files touched by this commit (3) | Package updated
Log message:
libcares: update to 1.23.0.

Version 1.23.0 (28 Nov 2023)

GitHub (28 Nov 2023)
- [Brad House brought this change]

  1.23.0 release prep (#641)

Brad House (28 Nov 2023)
- add missing manpage to distribution list

- clang-format

- remove a simply

- fix doc typo

- ares_init_options with ARES_OPT_UDP_PORT wrong byte order

  Regression from c-ares 1.19.1, ARES_OPT_UDP_PORT and ARES_OPT_TCP_PORT are
  specified from the user in host-byte order, but there was a regression that
  caused it to be read as if it was network byte order.

  Fixes Bug: #640
  Reported By: @Flow86
  Fix By: Brad House (@bradh352)

- fix ares_threadsafety() prototype

GitHub (28 Nov 2023)
- [Brad House brought this change]

  Basic Thread Safety (#636)

  c-ares does not have any concept of thread-safety. It has always been 100% up \ 
to the implementor to ensure they never call c-ares from more than one thread at \ 
a time. This patch adds basic thread-safety support, which can be disabled at \ 
compile time if not desired. It uses a single recursive mutex per channel, which \ 
should be extremely quick when uncontested so overhead should be minimal.

  Fixes Bug: #610

  Also sets the stage to implement #611

  Fix By: Brad House (@bradh352)

- [petrvh brought this change]

  ares_getaddrinfo(): do not use search domains if ARES_FLAG_NOSEARCH is set (#638)

  c-ares init options defines a flag ARES_FLAG_NOSEARCH that is supposed to \ 
prevent search using configured domain suffixes, however when using \ 
ares_getaddrinfo() the flag was ignored and domain suffixes were used anyway.

  Configuring zero domains to search also does not work (if ndomains == 0 \ 
default domain search list is loaded regardless of the flag ARES_OPT_DOMAINS \ 
being set).

  This change adds a check for the ARES_FLAG_NOSEARCH in as_is_only() function \ 
that is used by ares_getaddrinfo() to decide if to try to query next possible \ 
name ( next_dns_lookup() )

  Fix By: @petrvh

Brad House (25 Nov 2023)
- Fix MacOS version test

  It appears that the Issue #454 wasn't really fixed for some reason.  This \ 
commit should fix the detection.

  Fix By: Brad House (@bradh352)

Daniel Stenberg (24 Nov 2023)
- CI: codespell

  Closes #635

GitHub (24 Nov 2023)
- [Christian Clauss brought this change]

  Fix typos discovered by codespell (#634)

  % `codespell \ 
--ignore-words-list="aas,aci,acter,atleast,contentss,firey,fo,sais,seh,stat \ 
ics"`
  * https://pypi.org/project/codespell

  Fix By: Christian Clauss (@cclauss)

Brad House (22 Nov 2023)
- environment is meant as an override for sysconfig

GitHub (22 Nov 2023)
- [Ignat brought this change]

  Support attempts and timeout options from resolv.conf (#632)

  c-ares parses only antique version of options for timeout and number of \ 
retries from resolv.conf (`retrans` and `retry` are missing in modern \ 
documentation https://man7.org/linux/man-pages/man5/resolv.conf.5.html).

  I add support of `attempts` and `timeout` options

  Fix By: Ignat (@Kontakter)

- [Brad House brought this change]

  more precise timeout calculation (#633)

  The timeout calculation was occurring with millisecond precision, but on some \ 
systems, there is microsecond precision which could mean we'd tell a user a \ 
timeout time prior to the actual timeout.

  Fixes Bug: #631
  Fix By: Brad House (@bradh352)

- [Christian Clauss brought this change]

  INSTALL.md: Fix typo (#630)

  Fix By: Christian Clauss (@cclauss)

Brad House (19 Nov 2023)
- SonarCloud: fix minor codesmells

- fix test case regression due to missing parens

- now that warnings are enabled on test cases, clear a bunch of warnings

- CMake: CXXFLAGS environment wasn't being read because C++ compiler was enabled \ 
after settings warnings.

- fix additional windows test warnings

- cleanup some Windows warnings in test

- clang-format

GitHub (19 Nov 2023)
- [Brad House brought this change]

  Fix Windows UWP (Store) building and add to CI/CD (#627)

  When building for UWP (WindowsStore), additional headers are needed and some \ 
functions are not available. This also adds AppVeyor CI/CD support to catch \ 
these issues in the future.

  Fix By: Deal (@halx99) and Brad House (@bradh352)

Brad House (19 Nov 2023)
- ares_set_servers_*() should allow an empty server list

  For historic reasons, we have users depending on ares_set_servers_*()
  to return ARES_SUCCESS when passing no servers and actually *clear*
  the server list.  It appears they do this for test cases to simulate
  DNS unavailable or similar.  Presumably they could achieve the same
  effect in other ways (point to localhost on a port that isn't in use).
  But it seems like this might be wide-spread enough to cause headaches
  so we just will document and test for this behavior, clearly it hasn't
  caused "issues" for anyone with the old behavior.

  See: https://github.com/nodejs/node/pull/50800

  Fix By: Brad House (@bradh352)

GitHub (19 Nov 2023)
- [Brad House brought this change]

  Query Cache support (#625)

  This PR implements a query cache at the lowest possible level, the actual dns \ 
request and response messages.  Only successful and `NXDOMAIN` responses are \ 
cached. The lowest TTL in the response message determines the cache validity \ 
period for the response, and is capped at the configuration value for \ 
`qcache_max_ttl`.  For `NXDOMAIN` responses, the SOA record is evaluated.

  For a query to match the cache, the opcode, flags, and each question's class, \ 
type, and name are all evaluated.  This is to prevent matching a cached entry \ 
for a subtly different query (such as if the RD flag is set on one request and \ 
not another).

  For things like ares_getaddrinfo() or ares_search() that may spawn multiple \ 
queries, each individual message received is cached rather than the overarching \ 
response.  This makes it possible for one query in the sequence to be purged \ 
from the cache while others still return cached results which means there is no \ 
chance of ever returning stale data.

  We have had a lot of user requests to return TTLs on all the various parsers \ 
like `ares_parse_caa_reply()`, and likely this is because they want to implement \ 
caching mechanisms of their own, thus this PR should solve those issues as well.

  Due to the internal data structures we have these days, this PR is less than \ 
500 lines of new code.

  Fixes #608

  Fix By: Brad House (@bradh352)
   2023-11-22 12:48:32 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
libcares: updated to 1.22.1

c-ares version 1.22.1

Bugfixes:

Fix /etc/hosts processing performance with all entries using same IPaddress. \ 
Large hosts files using the same IP address for all entries could use \ 
exponential time.
Fix typos in manpages
Fix OpenWatcom building