Skip to content

Commit

Permalink
c-ares: upgrade library to 1.20.1 (#33711)
Browse files Browse the repository at this point in the history
This change does following:

* Updates c-ares library to 1.20 to get access to the required change in c-ares library.
* Updates dirty_channel status check logic to conditionally check for status == ARES_EREFUSED without which DestroyChannelOnRefused and CustomResolverValidAfterChannelDestruction test fail after upgrading the c-ares library to 1.20.1.

Risk Level: low
Testing: unit testing

Signed-off-by: deveshkandpal1224 <deveshkandpal1224@gmail.com>
  • Loading branch information
deveshkandpal1224 committed Apr 26, 2024
1 parent c15b875 commit c4f176d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ REPOSITORY_LOCATIONS_SPEC = dict(
project_name = "c-ares",
project_desc = "C library for asynchronous DNS requests",
project_url = "https://c-ares.haxx.se/",
version = "1.19.1",
sha256 = "321700399b72ed0e037d0074c629e7741f6b2ec2dda92956abe3e9671d3e268e",
version = "1.20.1",
sha256 = "de24a314844cb157909730828560628704f4f896d167dd7da0fa2fb93ea18b10",
strip_prefix = "c-ares-{version}",
urls = ["https://github.com/c-ares/c-ares/releases/download/cares-{underscore_version}/c-ares-{version}.tar.gz"],
use_category = ["dataplane_core", "controlplane"],
release_date = "2023-05-22",
release_date = "2023-10-08",
cpe = "cpe:2.3:a:c-ares_project:c-ares:*",
license = "c-ares",
license_url = "https://github.com/c-ares/c-ares/blob/cares-{underscore_version}/LICENSE.md",
Expand Down
6 changes: 5 additions & 1 deletion changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ bug_fixes:
change: |
Fix a RELEASE_ASSERT when using :ref:`auto_sni <envoy_v3_api_field_config.core.v3.UpstreamHttpProtocolOptions.auto_sni>`
if the downstream request ``:authority`` was longer than 255 characters.
- area: cares
change: |
Upgraded c-ares library to 1.20.1 and added fix to c-ares DNS implementation to additionally check for ``ARES_EREFUSED``,
``ARES_ESERVFAIL``and ``ARES_ENOTIMP`` status. Without this fix, ``DestroyChannelOnRefused`` and
``CustomResolverValidAfterChannelDestruction`` unit test will break.
removed_config_or_runtime:
# *Normally occurs at the end of the* :ref:`deprecation period <deprecated>`
Expand Down
3 changes: 2 additions & 1 deletion source/extensions/network/dns_resolver/cares/dns_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ void DnsResolverImpl::AddrInfoPendingResolution::onAresGetAddrInfoCallback(
//
// The channel cannot be destroyed and reinitialized here because that leads to a c-ares
// segfault.
if (status == ARES_ECONNREFUSED) {
if (status == ARES_ECONNREFUSED || status == ARES_EREFUSED || status == ARES_ESERVFAIL ||
status == ARES_ENOTIMP) {
parent_.dirty_channel_ = true;
}
}
Expand Down

0 comments on commit c4f176d

Please sign in to comment.