1 Changelog for the c-ares project. Generated with git2changes.pl 2 3Version 1.27.0 (22 Feb 2024) 4 5GitHub (22 Feb 2024) 6- [Brad House brought this change] 7 8 Release 1.27.0 (#715) 9 10 release prep for 1.27.0 release 11 12- [Brad House brought this change] 13 14 Merge pull request from GHSA-mg26-v6qh-x48q 15 16- [Oliver Welsh brought this change] 17 18 Add flag to not use a default local named server on channel initialization (#713) 19 20 Hello, I work on an application for Microsoft which uses c-ares to 21 perform DNS lookups. We have made some minor changes to the library over 22 time, and would like to contribute these back to the project in case 23 they are useful more widely. This PR adds a new channel init flag, 24 described below. 25 26 Please let me know if I can include any more information to make this PR 27 better/easier for you to review. Thanks! 28 29 **Summary** 30 When initializing a channel with `ares_init_options()`, if there are no 31 nameservers available (because `ARES_OPT_SERVERS` is not used and 32 `/etc/resolv.conf` is either empty or not available) then a default 33 local named server will be added to the channel. 34 35 However in some applications a local named server will never be 36 available. In this case, all subsequent queries on the channel will 37 fail. 38 39 If we know this ahead of time, then it may be preferred to fail channel 40 initialization directly rather than wait for the queries to fail. This 41 gives better visibility, since we know that the failure is due to 42 missing servers rather than something going wrong with the queries. 43 44 This PR adds a new flag `ARES_FLAG_NO_DFLT_SVR`, to indicate that a 45 default local named server should not be added to a channel in this 46 scenario. Instead, a new error `ARES_EINITNOSERVER` is returned and 47 initialization fails. 48 49 **Testing** 50 I have added 2 new FV tests: 51 - `ContainerNoDfltSvrEmptyInit` to test that initialization fails when 52 no nameservers are available and the flag is set. 53 - `ContainerNoDfltSvrFullInit` to test that initialization still 54 succeeds when the flag is set but other nameservers are available. 55 56 Existing FVs are all passing. 57 58 **Documentation** 59 I have had a go at manually updating the docs to describe the new 60 flag/error, but couldn't see any contributing guidance about testing 61 this. Please let me know if you'd like anything more here. 62 63 --------- 64 65 Fix By: Oliver Welsh (@oliverwelsh) 66 67Brad House (18 Feb 2024) 68- badge should be only main branch 69 70- put logo in readme 71 72- clang-format 73 74GitHub (17 Feb 2024) 75- [Brad House brought this change] 76 77 Add ares_queue_active_queries() (#712) 78 79 Add a function to request the number of active queries from an ares 80 channel. This will return the number of inflight requests to dns 81 servers. Some functions like `ares_getaddrinfo()` when using `AF_UNSPEC` 82 may enqueue multiple queries which will be reflected in this count. 83 84 In the future, if we implement support for queuing (e.g. for throttling 85 purposes), and/or implement support for tracking user-requested queries 86 (e.g. for cancelation), we can provide additional functions for 87 inspecting those queues. 88 89 Fix By: Brad House (@bradh352) 90 91- [Vojtěch Vobr brought this change] 92 93 fix leaking DNS suffix search list on Windows (#711) 94 95 ares__strsplit provides a newly allocated buffer, so suffix list in 96 line variable isn't referenced anymore. Related ares_free seems to 97 have gone missing during refactoring made in #594 98 99 Fix By: Vojtěch Vobr (@vojtechvobr) 100 101- [Brad House brought this change] 102 103 Add ares_queue_wait_empty() for use with EventThreads (#710) 104 105 It may be useful to wait for the queue to be empty under certain conditions (mainly test cases), expose a function to efficiently do this and rework test cases to use it. 106 107 Fix By: Brad House (@bradh352) 108 109- [Cheng Zhao brought this change] 110 111 Fix warning about ignoring result of write (#709) 112 113 Fix the compiler warning from clang: 114 115 ``` 116 ares_event_wake_pipe.c:120:3: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] 117 120 | write(p->filedes[1], "1", 1); 118 | ^~~~~ ~~~~~~~~~~~~~~~~~~~~~ 119 1 error generated. 120 ``` 121 122 Fix By: Cheng Zhao (@zcbenz) 123 124Brad House (5 Feb 2024) 125- CMake: don't override target output locations if not top-level 126 127 CMake was unconditionally setting output locations globally, but 128 it should not do that if it is not the top-level project (e.g. 129 during chain building). Detect this fact and only set the output 130 location when top level. 131 132 Fixes Issue: #708 133 Fix By: Anthony Alayo (@anthonyalayo) 134 135- make docs match PR #705 136 137GitHub (31 Jan 2024) 138- [Cristian Rodríguez brought this change] 139 140 lower EDNSPACKETSZ to 1232 (#705) 141 142 In 2020, it was agreed this is optimal maximum size and all 143 major server software was updated to reflect this. 144 145 see https://www.dnsflagday.net/2020/#faq 146 147 Fix By: Cristian Rodríguez (@crrodriguez) 148 149Brad House (30 Jan 2024) 150- fix version 151 152- fix typo 153 154- bad symlink 155 156- attempt to fix pkgconfig on windows for static builds 157 158GitHub (28 Jan 2024) 159- [Andriy Utkin brought this change] 160 161 docs/ares_init_options.3: fix args in analogy (#701) 162 163 Fix By: Andriy Utkin <hello@autkin.net> 164 165- [Brad House brought this change] 166 167 sonarcloud: fix minor codesmells (#702) 168 169 Fix minor codesmells, mostly related to missing 'const' in the new event system. 170 171 Fix By: Brad House (@bradh352) 172 173Brad House (26 Jan 2024) 174- remove outdated copyright text 175 176- spelling 177 178- sanity check GTest includes GMock component 179 180GitHub (26 Jan 2024) 181- [Brad House brought this change] 182 183 build-time disabled threads breaks c-ares (#700) 184 185 Regression introduced in 1.26.0, building c-ares with threading disabled results in ares_init{_options}() failing. 186 187 Also adds a new CI test case to prevent this regression in the future. 188 189 Fixes Bug: #699 190 Fix By: Brad House (@bradh352) 191 192Version 1.26.0 (25 Jan 2024) 193 194Brad House (25 Jan 2024) 195- clusterfuzz: enforce maximum DNS packet size due to long parser time 196 197GitHub (24 Jan 2024) 198- [Brad House brought this change] 199 200 Release prep for c-ares 1.26.0 (#698) 201 202 release prep 203 204Brad House (24 Jan 2024) 205- adig: Differentiate between internal and server error 206 207 Should not output "Got answer" if there was no answer from the 208 server, instead should just output the internal error. 209 210 Fix By: Gisle Vanem (@gvanem) 211 212GitHub (24 Jan 2024) 213- [Brad House brought this change] 214 215 Event Subsystem: No longer require integrators to have their own (#696) 216 217 This PR implements an event thread to process all events on file descriptors registered by c-ares. Prior to this feature, integrators were required to understand the internals of c-ares and how to monitor file descriptors and timeouts and process events. 218 219 Implements OS-specific efficient polling such as epoll(), kqueue(), or IOCP, and falls back to poll() or select() if otherwise unsupported. At this point, it depends on basic threading primitives such as pthreads or windows threads. 220 221 If enabled via the ARES_OPT_EVENT_THREAD option passed to ares_init_options(), then socket callbacks cannot be used. 222 223 Fixes Bug: #611 224 Fix By: Brad House (@bradh352) 225 226- [Erik Lax brought this change] 227 228 Added flags to are_dns_parse to force RAW packet parsing (#693) 229 230 This pull request adds six flags to instruct the parser under various circumstances to skip parsing of the returned RR records so the raw data can be retrieved. 231 232 Fixes Bug: #686 233 Fix By: Erik Lax (@eriklax) 234 235- [Brad House brought this change] 236 237 Autotools allow make to override CFLAGS/CPPFLAGS/CXXFLAGS (#695) 238 239 The previous build system allowed overwriting of CFLAGS/CPPFLAGS/CXXFLAGS on the make command line. Switch to using AM_CFLAGS/AM_CPPFLAGS/AM_CXXFLAGS when we set our own flags for building which ensures they are kept even when a user tries to override. 240 241 Fixes Bug: #694 242 Fix By: Brad House (@bradh352) 243 244Brad House (16 Jan 2024) 245- fix doxygen typo 246 247GitHub (16 Jan 2024) 248- [Brad House brought this change] 249 250 man ares_fds(3): mark as deprecated and add explanation (#691) 251 252 ares_fds(3) is not safe to use, mark as deprecated. 253 254 Fixes Issue: #687 255 Fix By: Brad House (@bradh352) 256 257- [Brad House brought this change] 258 259 autotools: fix building for 32bit windows due to stdcall symbol mangling (#689) 260 261 Use AC_CHECK_DECL not AC_CHECK_FUNCS, while this doesn't do a linkage test, it just makes sure the headers define it, this is the only thing without a complex workaround on Windows that will do what we need. 262 263 See: 264 265 https://github.com/msys2/msys2/wiki/Porting/f87a222118b1008ebc166ad237f04edb759c8f4c#calling-conventions-stdcall-and-autotools 266 267 and 268 269 https://lists.gnu.org/archive/html/autoconf/2013-05/msg00085.html 270 271 and for a more complex workaround, we'd need to use AC_LINK_IFELSE like: 272 273 https://mailman.videolan.org/pipermail/vlc-devel/2015-March/101802.html 274 275 which would require we check each individually and provide function arguments for the test. I don't think that is worthwhile. 276 277 Fixes Issue: #688 278 Fix By: Brad House (@bradh352) 279 280- [Brad House brought this change] 281 282 Do not sanity check RR Name vs Question (#685) 283 284 It appears as though we should never sanity check the RR name vs the question name as some DNS servers may return results for alias records. 285 286 Fixes Bug: #683 287 Fix By: Brad House (@bradh352) 288 289- [Brad House brought this change] 290 291 no reason to include sys/random.h all the time (#684) 292 293 External integrations don't need sys/random.h in order to compile, remove the dependency. Try to fix building on legacy MacOS versions. 294 295 Fixes Issue: #682 296 Fix By: Brad House (@bradh352) 297 298- [Gregor Jasny brought this change] 299 300 cmake: improve some include related code (#680) 301 302 * cmake: avoid warning about non-existing include dir 303 304 In the Debian build logs I noticed the following warning: 305 cc1: warning: /build/c-ares-1.25.0/test/include: No such file or directory [-Wmissing-include-dirs] 306 307 This happened because ${CMAKE_INSTALL_INCLUDEDIR} had been added to 308 caresinternal. I believe it has been copied from the "real" lib 309 where it's used in the INSTALL_INTERFACE context. But because 310 caresinternal is never installed we don't need that include here. 311 312 * cmake: drop CARES_TOPLEVEL_DIR variable 313 314 The CARES_TOPLEVEL_DIR variable is the same as the automatically 315 created PROJECT_SOURCE_DIR variable. Let's stick to the official 316 one. Also because it is already used at places where CARES_TOPLEVEL_DIR 317 is used as well. 318 319 Fix By: Gregor Jasny (@gjasny) 320 321Brad House (5 Jan 2024) 322- test: fix outdated license headers 323 324- RELEASE-NOTES -> RELEASE-NOTES.md 325 326- update format slightly 327 328- update release notes format 329 330Version 1.25.0 (2 Jan 2024) 331 332GitHub (2 Jan 2024) 333- [Brad House brought this change] 334 335 1.25.0 release prep (#676) 336 337Brad House (31 Dec 2023) 338- tests: replace google DNS with CloudFlare for reverse lookups as google's servers stopped responding properly 339 340- 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. 341 342- autotools: update logic for building tests to provide more feedback 343 344- set winver consistently across build systems 345 346GitHub (28 Dec 2023) 347- [Brad House brought this change] 348 349 Autotools: rework to simplify and fix recent issues (#674) 350 351 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). 352 353 Changes include: 354 355 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. 356 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. 357 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. 358 Only require CARES_STATICLIB definition on Windows static builds, its not necessary ever for other systems, even when hiding non-public symbols. 359 Remove some function and definition detections that were never used in c-ares 360 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. 361 As a side-effect of the changes, a configure run completes in about 25% of the original time. 362 363 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. 364 365 Fixes Bug: #670 366 Fix By: Brad House (@bradh352) 367 368Brad House (22 Dec 2023) 369- docs: host -> ip 370 371 fix mismatched documentation stating host instead of ip 372 373 Fix By: Brad House (@bradh352) 374 375GitHub (21 Dec 2023) 376- [Brad House brought this change] 377 378 Old MacOS SDKs require you include sys/socket.h before net/if.h (#673) 379 380 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. 381 382 Fixes Issue: #672 383 Fix By: Brad House (@bradh352) 384 385- [Brad House brought this change] 386 387 Autotools warning fixes (#671) 388 389 * get rid of clashes with curl namespace 390 * remove warnings due to deprecated functionality 391 * reorder some macro calls to get rid of warnings due to being called in the wrong order 392 393 Fix By: Brad House (@bradh352) 394 395Brad House (19 Dec 2023) 396- clang-format 397 398- ares_strsplit() rewrite as wrapper around ares__buf_split() 399 400 We want to limit as much as possible any hand written parsers. 401 ares__buf_split() uses the new memory-safe parsing routines. This 402 adds a couple of additional flags to remove duplicates which the 403 existing split code did. 404 405 Fix By: Brad House (@bradh352) 406 407- clang-format 408 409- sonarcloud: const 410 411- Connection failure should increment server failure count first 412 413 In order to be sure a different server is chosen on the next query, 414 a read error should result in the failure count being updated 415 first before requeing the request to a different server. 416 417 Fix By: Brad House (@bradh352) 418 419GitHub (18 Dec 2023) 420- [Brad House brought this change] 421 422 ahost should use ares_getaddrinfo() these days (#669) 423 424 ahost wasn't printing both ipv4 and ipv6 addresses. This day and age, it really should. 425 426 This PR also adds the ability to specify the servers to use. 427 428 Fix By: Brad House (@bradh352) 429 430Brad House (17 Dec 2023) 431- Fix bad stub for ares__iface_ips_enumerate() 432 433 If the ability to enumerate interface ip addresses does not exist 434 on a system, the stub function contained the wrong prototype. 435 436 Fixes Bug: #668 437 Fix By: Brad House (@bradh352) 438 439GitHub (17 Dec 2023) 440- [Gregor Jasny brought this change] 441 442 Fix minor warnings and documentation typos (#666) 443 444 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) 445 446 Fix By: Gregor Jasny (@gjasny) 447 448- [Brad House brought this change] 449 450 CI: Add Alpine Linux and old Ubuntu (#667) 451 452 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. 453 454 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. 455 456 Fix By: Brad House (@bradh352) 457 458Brad House (17 Dec 2023) 459- fix support with older google test versions 460 461- getrandom() may require sys/random.h on some systems 462 463 There is a reported build issue where getrandom() is detected 464 but compile fails due to a missing prototype. This commit attempts 465 to resolve that issue. 466 467 Fixes Bug: #665 468 Fix By: Brad House (@bradh352) 469 470GitHub (17 Dec 2023) 471- [Martin Chang brought this change] 472 473 Use SOCK_DNS extension on socket on OpenBSD (#659) 474 475 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. 476 477 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. 478 479 Fix By: Martin Chang (@marty1885) 480 481Brad House (17 Dec 2023) 482- ci: disable static for symbol hiding tests 483 484- ci: add test case for building with hidden symbol visibility 485 486- fix test building with symbol hiding 487 488 New test cases depend on internal symbols for calculating timeouts. 489 Disable those test features if symbol hiding is enabled. 490 491 Fixes Bug: #664 492 Fix By: Brad House (@bradh352) 493 494Version 1.24.0 (16 Dec 2023) 495 496GitHub (16 Dec 2023) 497- [Brad House brought this change] 498 499 ares_cancel() could trigger callback with wrong response code (#663) 500 501 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. 502 503 Test case has been added for this specific condition. 504 505 Fixes Bug: #662 506 Fix By: Brad House (@bradh352) 507 508- [Brad House brought this change] 509 510 rand: allow fallback from OS (#661) 511 512 getrandom() can fail with ENOSYS if the libc supports the function but the kernel does not. 513 514 Fixes Bug: #660 515 Fix By: Brad House (@bradh352) 516 517- [Brad House brought this change] 518 519 1.24.0 release prep (#657) 520 521Brad House (11 Dec 2023) 522- reference alternative to ares_getsock() in docs 523 524- tag some functions as deprecated in docs 525 526- Coverity: fix allocation size as reported in new code 527 528- remove dead code: ares_iphlpapi.h 529 530- remove dead code: bitncmp 531 532GitHub (9 Dec 2023) 533- [Brad House brought this change] 534 535 Use external GoogleTest instead of bundling it (#655) 536 537 GoogleTest should be unbundled. Google changed their guidance a few years back and modern versions of google test cannot build the bundling code file. 538 539 This PR also updates to use C++14 as is required by modern GoogleTest versions. 540 541 Fixes Bug: #506 542 Fix By: Brad House (@bradh352) 543 544Brad House (8 Dec 2023) 545- use IF_NAMESIZE instead of IFNAMSIZ to avoid warning 546 547- remove redundant cast 548 549- clang-format and fix one warning 550 551GitHub (8 Dec 2023) 552- [Brad House brought this change] 553 554 Clean up some Windows-only warnings (#654) 555 556 Windows was emitting some warnings due to datatype differences. 557 558 Fix By: Brad House (@bradh352) 559 560- [Brad House brought this change] 561 562 Rewrite sortlist hand parser for memory safety and bugs (#653) 563 564 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. 565 566 Fixes Bug: #501 567 Fix By: Brad House (@bradh352) 568 569Brad House (8 Dec 2023) 570- enhance timeout test case to make sure it will re-use a previously downed server 571 572- enhance timeout test case 573 574- SonarCloud: make const 575 576GitHub (7 Dec 2023) 577- [Brad House brought this change] 578 579 increment failures on timeout (#651) 580 581 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. 582 583 This PR fixes the bug and adds a test case to ensure it behaves properly. 584 585 Fixes Bug: #650 586 Fix By: Brad House (@bradh352) 587 588- [Brad House brought this change] 589 590 Windows UBSAN tests (#649) 591 592 Fix UBSAN error, and enable UBSAN testing in AppVeyor. 593 594 Fixes Bug #648 595 Fix By: Gisle Vanem (@gvanem) 596 597- [Brad House brought this change] 598 599 Support ipv6 link-local servers and %iface syntax (#646) 600 601 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. 602 603 This PR adds support for the %iface modifier when setting DNS servers via `/etc/resolv.conf` as well as via `ares_set_servers_csv()`. 604 605 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. 606 607 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. 608 609 At this point, Android support does not exist. 610 611 Fixes Bug #462 612 Supersedes PR #463 613 614 Fix By: Brad House (@bradh352) and Serhii Purik (@sergvpurik) 615 616Brad House (4 Dec 2023) 617- silence openwatcom warning due to qcache_max_ttl being unsigned 618 619- ares__round_up_pow2() work around bogus warning 620 621 On 32bit systems, a codeblock that would intentionally never 622 be executed was emitting a warning. Rework the code to 623 prevent the warning. More code, no behavior difference, but 624 keeps people from complaining about the warning... 625 626 Fixes Bug: #645 627 Fix By: Brad House (@bradh352) 628 629- try to move AC_USE_SYSTEM_EXTENSIONS 630 631- Enable system extensions 632 633 Certain defines are needed on some systems to enable functionality like 634 pthread recursive mutexes. 635 636 Fixes #644 637 Fix By: Brad House (@bradh352) 638 639- ares_init_options() with invalid options values should unset the option 640 641 Apparently nodejs is relying on the above behavior for legacy reasons. Add 642 sanity checks to the various optmask parameters where it makes sense. 643 644 See https://github.com/nodejs/node/pull/50800 645 646 Fix By: Brad House (@bradh352) 647 648- SonarCloud: silence bogus reported error 649 650- clang-format 651 652GitHub (2 Dec 2023) 653- [Brad House brought this change] 654 655 Nameserver parsing: replace another hand-written parser (#643) 656 657 This replaces the nameserver parsing code with code that use ares__buf_*() in the name of memory safety. 658 659 Fix By: Brad House (@bradh352) 660 661Version 1.23.0 (28 Nov 2023) 662 663GitHub (28 Nov 2023) 664- [Brad House brought this change] 665 666 1.23.0 release prep (#641) 667 668Brad House (28 Nov 2023) 669- add missing manpage to distribution list 670 671- clang-format 672 673- remove a simply 674 675- fix doc typo 676 677- ares_init_options with ARES_OPT_UDP_PORT wrong byte order 678 679 Regression from c-ares 1.19.1, ARES_OPT_UDP_PORT and ARES_OPT_TCP_PORT are 680 specified from the user in host-byte order, but there was a regression that 681 caused it to be read as if it was network byte order. 682 683 Fixes Bug: #640 684 Reported By: @Flow86 685 Fix By: Brad House (@bradh352) 686 687- fix ares_threadsafety() prototype 688 689GitHub (28 Nov 2023) 690- [Brad House brought this change] 691 692 Basic Thread Safety (#636) 693 694 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. 695 696 Fixes Bug: #610 697 698 Also sets the stage to implement #611 699 700 Fix By: Brad House (@bradh352) 701 702- [petrvh brought this change] 703 704 ares_getaddrinfo(): do not use search domains if ARES_FLAG_NOSEARCH is set (#638) 705 706 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. 707 708 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). 709 710 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() ) 711 712 Fix By: @petrvh 713 714Brad House (25 Nov 2023) 715- Fix MacOS version test 716 717 It appears that the Issue #454 wasn't really fixed for some reason. This commit should fix the detection. 718 719 Fix By: Brad House (@bradh352) 720 721Daniel Stenberg (24 Nov 2023) 722- CI: codespell 723 724 Closes #635 725 726GitHub (24 Nov 2023) 727- [Christian Clauss brought this change] 728 729 Fix typos discovered by codespell (#634) 730 731 % `codespell --ignore-words-list="aas,aci,acter,atleast,contentss,firey,fo,sais,seh,statics"` 732 * https://pypi.org/project/codespell 733 734 Fix By: Christian Clauss (@cclauss) 735 736Brad House (22 Nov 2023) 737- environment is meant as an override for sysconfig 738 739GitHub (22 Nov 2023) 740- [Ignat brought this change] 741 742 Support attempts and timeout options from resolv.conf (#632) 743 744 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). 745 746 I add support of `attempts` and `timeout` options 747 748 Fix By: Ignat (@Kontakter) 749 750- [Brad House brought this change] 751 752 more precise timeout calculation (#633) 753 754 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. 755 756 Fixes Bug: #631 757 Fix By: Brad House (@bradh352) 758 759- [Christian Clauss brought this change] 760 761 INSTALL.md: Fix typo (#630) 762 763 Fix By: Christian Clauss (@cclauss) 764 765Brad House (19 Nov 2023) 766- SonarCloud: fix minor codesmells 767 768- fix test case regression due to missing parens 769 770- now that warnings are enabled on test cases, clear a bunch of warnings 771 772- CMake: CXXFLAGS environment wasn't being read because C++ compiler was enabled after settings warnings. 773 774- fix additional windows test warnings 775 776- cleanup some Windows warnings in test 777 778- clang-format 779 780GitHub (19 Nov 2023) 781- [Brad House brought this change] 782 783 Fix Windows UWP (Store) building and add to CI/CD (#627) 784 785 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. 786 787 Fix By: Deal (@halx99) and Brad House (@bradh352) 788 789Brad House (19 Nov 2023) 790- ares_set_servers_*() should allow an empty server list 791 792 For historic reasons, we have users depending on ares_set_servers_*() 793 to return ARES_SUCCESS when passing no servers and actually *clear* 794 the server list. It appears they do this for test cases to simulate 795 DNS unavailable or similar. Presumably they could achieve the same 796 effect in other ways (point to localhost on a port that isn't in use). 797 But it seems like this might be wide-spread enough to cause headaches 798 so we just will document and test for this behavior, clearly it hasn't 799 caused "issues" for anyone with the old behavior. 800 801 See: https://github.com/nodejs/node/pull/50800 802 803 Fix By: Brad House (@bradh352) 804 805GitHub (19 Nov 2023) 806- [Brad House brought this change] 807 808 Query Cache support (#625) 809 810 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. 811 812 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). 813 814 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. 815 816 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. 817 818 Due to the internal data structures we have these days, this PR is less than 500 lines of new code. 819 820 Fixes #608 821 822 Fix By: Brad House (@bradh352) 823 824Version 1.22.1 (17 Nov 2023) 825 826GitHub (17 Nov 2023) 827- [Brad House brought this change] 828 829 1.22.1 release prep (#624) 830 831Brad House (17 Nov 2023) 832- ares__htable_strvp should be case-insensitive 833 834- optimize: large /etc/hosts files reading 835 836 profiling found some hot paths that could be optimized to reduce 837 insert times into the cache. 838 839 Fix By: Brad House (@bradh352) 840 841- Fix /etc/hosts processing performance with all entries using same IP address 842 843 Some users use blacklist files like https://github.com/StevenBlack/hosts which 844 can contain 200k+ host entries all pointing to 0.0.0.0. Due to the merge 845 logic in the new hosts processor, all those entries will be associated as 846 aliases for the same ip address. 847 848 The first issue is that it attempts to check the status of all the hosts for 849 the merged entry, when it should only be checking the new hosts added to the 850 merged entry, so this caused exponential time as the entries got longer. 851 852 The next issue is if searching for one of those hosts, it would append all 853 the matches as cnames/aliases, but there is zero use for 200k aliases 854 being appended to a lookup, so we are artificially capping this to 100. 855 856 Bug report reference: https://bugs.gentoo.org/917400 857 858 Fix By: Brad House (@bradh352) 859 860- new badges 861 862- OpenWatcom: time_t is unsigned, change math using time_t to promote to a 64bit signed integer 863 864- fix more docs 865 866GitHub (15 Nov 2023) 867- [Gregor Jasny brought this change] 868 869 Fix typos and man page whatis entry (#619) 870 871 Those issues were detected by lintian. 872 873 Fix By: Gregor Jasny (@gjasny) 874 875- [Douglas R. Reno brought this change] 876 877 Fix building c-ares-1.22.0 and higher under Watcom. (#623) 878 879 Update config-win32.h to define HAVE_STDINT_H when OpenWatcom is in use. 880 881 Fix By: Douglas R. Reno (@renodr) 882 883Brad House (15 Nov 2023) 884- OpenWatcom: fix PR building 885 886- CI/CD: Add OpenWatcom 887 888- CI/CD: Add OpenWatcom 889 890- CI/CD: Add OpenWatcom 891 892- CI/CD: Add OpenWatcom 893 894- CI/CD: Add OpenWatcom 895 896- CI/CD: Add OpenWatcom 897 898- CI/CD: Add OpenWatcom 899 900- warnings: try to prevent warnings due to automatic integer promotion 901 902- only push to coverity weekly or on explicit coverity_scan branch commits 903 904- try to cleanup bogus compiler warnings 905 906- try to cleanup bogus compiler warnings 907 908- additional test coverage 909 910- Coverity: omit tests 911 912- Coverity: more 913 914- Coverity: silence false positives 915 916Version 1.22.0 (14 Nov 2023) 917 918Brad House (14 Nov 2023) 919- fix workflow 920 921- try a different coverity workflow 922 923GitHub (14 Nov 2023) 924- [Brad House brought this change] 925 926 coverity workflow (#618) 927 928Brad House (14 Nov 2023) 929- typos 930 931- getaddrinfo ESERVICE 932 933GitHub (14 Nov 2023) 934- [Brad House brought this change] 935 936 Release 1.22.0 (#616) 937 938Brad House (13 Nov 2023) 939- SonarCloud: minor codesmells 940 941- clang-format 942 943- Extended RCODE in OPT RR PsuedoRecord should not be exposed directly, it should be presented as part of the normal rcode 944 945- Slight fixes for PR #615 946 947 1. the maxtimeout must come at the end of the structure 948 2. fix comment form to be C style 949 3. fix timeplus randomness if statement 950 951GitHub (13 Nov 2023) 952- [Brad House brought this change] 953 954 Add DNS record manpages (#615) 955 956 The new DNS record parser and writer needs manpages. This PR implements those. 957 958 Fix By: Brad House (@bradh352) 959 960- [Ignat brought this change] 961 962 Randomize retry penalties to prevent thundering herd type issues (#606) 963 964 The retry timeout values were using a fixed calculation which could cause multiple simultaneous queries to timeout and retry at the exact same time. If a DNS server is throttling requests, this could cause the issue to never self-resolve due to all requests recurring at the same instance again. 965 966 This PR also creates a maximum timeout option to make sure the random value selected does not exceed this value. 967 968 Fix By: Ignat (@Kontakter) 969 970Brad House (13 Nov 2023) 971- fix typos 972 973- some simplification and better error handling 974 975- SonarCloud: fix some minor codesmells 976 977GitHub (12 Nov 2023) 978- [Brad House brought this change] 979 980 Implement ares_reinit() to reload system configuration into existing channel (#614) 981 982 This PR implements ares_reinit() to safely reload a channel's configuration even if there are existing queries. This function can be called when system configuration is detected to be changed, however since c-ares isn't thread aware, care must be taken to ensure no other c-ares calls are in progress at the time this function is called. Also, this function may update the open file descriptor list so care must also be taken to wake any event loops and reprocess the list of file descriptors. 983 984 Fixes Bug #301 985 986 Fix By: Brad House (@bradh352) 987 988Brad House (11 Nov 2023) 989- test case ensures tag for caa is not blank 990 991- 0-length strings are ok 992 993- SonarCloud: fix up codesmells 994 995GitHub (11 Nov 2023) 996- [Brad House brought this change] 997 998 rewrite adig using new helpers (#607) 999 1000 adig previously performed manual parsing of the DNS records. Now it can focus strictly on formatting of output data for printing. It simply iterates across the parsed DNS packet and queries for the RRs, parameters for each RR, and the datatypes for each parameter. adig will now automatically pick up new RRs from the c-ares library due to the dynamic nature. 1001 1002 The adig format also now more closely resembles that of BIND's `dig` output. 1003 1004 A few more helpers needed to be added to the c-ares library that were missing. There ware a couple of minor bugs and enhancements also needed. 1005 1006 Example: 1007 ``` 1008 ./adig -t ANY www.google.com 1009 1010 ; <<>> c-ares DiG 1.21.0 <<>> www.google.com 1011 ;; Got answer: 1012 ;; ->>HEADER<<- opcode: QUERY, status: RCODE, id: 23913 1013 ;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 1 1014 1015 ;; OPT PSEUDOSECTION: 1016 ; EDNS: version: 0, flags: 0; udp: 512 1017 ;; QUESTION SECTION: 1018 ;www.google.com. IN ANY 1019 1020 ;; ANSWER SECTION: 1021 www.google.com. 162 IN A 142.251.107.99 1022 www.google.com. 162 IN A 142.251.107.105 1023 www.google.com. 162 IN A 142.251.107.103 1024 www.google.com. 162 IN A 142.251.107.147 1025 www.google.com. 162 IN A 142.251.107.104 1026 www.google.com. 162 IN A 142.251.107.106 1027 www.google.com. 162 IN AAAA 2607:f8b0:400c:c32::93 1028 www.google.com. 162 IN AAAA 2607:f8b0:400c:c32::69 1029 www.google.com. 162 IN AAAA 2607:f8b0:400c:c32::68 1030 www.google.com. 162 IN AAAA 2607:f8b0:400c:c32::6a 1031 www.google.com. 21462 IN HTTPS 1 . alpn="h2,h3" 1032 1033 ;; MSG SIZE rcvd: 276 1034 ``` 1035 1036 Fix By: Brad House (@bradh352) 1037 1038- [Brad House brought this change] 1039 1040 make dns parser/writer public (#604) 1041 1042 This PR makes the c-ares parser introduced in 1.21, and the new writer, along with associated helpers public. These helpers are contained in a new public header of `ares_dns_record.h` which should _**not**_ be included directly, instead simply including `ares.h` is sufficient. This will address #587, as well as #470. 1043 1044 A follow-up PR will be made which will transform `adig` to use the new parsers and helpers. 1045 1046 This PR does not currently add man pages for these public functions, that will be in a follow-up PR once the `adig` migration is done which may expose additional needed helpers. 1047 1048 The two aforementioned PRs will be done before the 1.22 release. 1049 1050 Fix By: Brad House (@bradh352) 1051 1052Brad House (9 Nov 2023) 1053- options helpers: fix dereference to properly return params 1054 1055- clang-format 1056 1057GitHub (9 Nov 2023) 1058- [Brad House brought this change] 1059 1060 Add SVCB and HTTPS RR (RFC 9460) (#603) 1061 1062 This PR adds parsing and writing support for SVCB and HTTPS RRs as defined in RFC 9460. 1063 1064 This should fix #566 1065 1066 Fix By: Brad House (@bradh352) 1067 1068- [Brad House brought this change] 1069 1070 OPT RR should support parsing key/value options (#602) 1071 1072 The OPT RR record has some seldom used options with a 16bit key and a binary value. The current parser and writer was not supporting this. This PR adds support. The same format is also used for SVCB/HTTPS records, so getting this in there is necessary to support that RR type. 1073 1074 Also, we split the Binary record format into BIN and BINP, where BINP is an indicator that the binary data is _likely_ printable and will guarantee a NULL terminator. This is helpful for those attempting to print RRs. 1075 1076 Fix By: Brad House (@bradh352) 1077 1078Brad House (8 Nov 2023) 1079- SonarCloud: fix some easy codesmells 1080 1081- clang-format 1082 1083- Mark a couple of parameters as const in the public API 1084 1085GitHub (7 Nov 2023) 1086- [Brad House brought this change] 1087 1088 Add TLSA record support (#600) 1089 1090 As per #470, c-ares is missing a parser for the TLSA record format (RFC 6698). This PR introduces that parser. 1091 1092 Once the new parser interface becomes public and this PR is merged, then #470 can be closed. 1093 1094 Fix By: Brad House (@bradh352) 1095 1096Brad House (7 Nov 2023) 1097- memory leak in test case 1098 1099- fix bad variable reference 1100 1101- DNS Write: fix name compression 1102 1103- SonarCloud: fix codesmells 1104 1105- Coverage: add tests for writing and parsing various record formats 1106 1107GitHub (7 Nov 2023) 1108- [Brad House brought this change] 1109 1110 DNS Record Write (#598) 1111 1112 The `ares_dns_record_t` data structure created in the prior release is capable of holding a complete parsed DNS message and also provides all helpers in order to fill in the data structure. This PR adds write capabilities for this data structure to form a complete message and supports features such as DNS name compression as defined in RFC1035. Though this message writing capability goes further than c-ares internally needs, external users may find it useful ... and we may find it useful for test validation as well. 1113 1114 This also replaces the existing message writing code in `ares_create_query()`, as well rewriting the request message without EDNS in ares_process.c's `process_answer()`. 1115 1116 Fix By: Brad House (@bradh352) 1117 1118Brad House (6 Nov 2023) 1119- PATH_RESOLV_CONF: use empty string instead of NULL to prevent warnings 1120 1121- build fix 1122 1123- const: fix some usecases 1124 1125- remove tests that depend on randomness 1126 1127GitHub (5 Nov 2023) 1128- [Brad House brought this change] 1129 1130 Use EDNS by default (#596) 1131 1132 All DNS servers support EDNS, by using this by default, it will allow larger responses without the need to switch to TCP. If by chance a DNS server is hit that doesn't support EDNS, this is detected due to the lack of the OPT RR in the response and will be automatically retried without EDNS. 1133 1134 Fix By: Brad House (@bradh352) 1135 1136- [Brad House brought this change] 1137 1138 `ares_channel` -> `ares_channel_t *`: don't bury the pointer (#595) 1139 1140 `ares_channel` is defined as `typedef struct ares_channeldata *ares_channel;`. The problem with this, is it embeds the pointer into the typedef, which means an `ares_channel` can never be declared as `const` as if you write `const ares_channel channel`, that expands to `struct ares_channeldata * const ares_channel` and not `const struct ares_channeldata *channel`. 1141 1142 We will now typedef `ares_channel_t` as `typedef struct ares_channeldata ares_channel_t;`, so if you write `const ares_channel_t *channel`, it properly expands to `const struct ares_channeldata *channel`. 1143 1144 We are maintaining the old typedef for API compatibility with existing integrations, and due to typedef expansion this should not even cause any compiler warnings for existing code. There are no ABI implications with this change. I could be convinced to keep existing public functions as `ares_channel` if a sufficient argument exists, but internally we really need make this change for modern best practices. 1145 1146 This change will allow us to internally use `const ares_channel_t *` where appropriate. Whether or not we decide to change any public interfaces to use `const` may require further discussion on if there might be ABI implications (I don't think so, but I'm also not 100% sure what a compiler internally does with `const` when emitting machine code ... I think more likely ABI implications would occur going the opposite direction). 1147 1148 FYI, This PR was done via a combination of sed and clang-format, the only manual code change was the addition of the new typedef, and a couple doc fixes :) 1149 1150 Fix By: Brad House (@bradh352) 1151 1152Brad House (4 Nov 2023) 1153- win32 warnings look good, remove commented out block 1154 1155- more msvc warnings 1156 1157- fix 1158 1159- docs: document setting servers can be done live 1160 1161- SonarCloud: more easy codesmells 1162 1163- clang-format 1164 1165- SonarCloud: fix up codesmells 1166 1167GitHub (3 Nov 2023) 1168- [Brad House brought this change] 1169 1170 Dynamic Server List (#594) 1171 1172 This PR makes the server list a dynamic sorted list of servers. The sort order is [ consecutive failures, system config index ]. The server list can be updated via ares_set_servers_*(). Any queries currently directed to servers that are no longer in the list will be automatically re-queued to a different server. 1173 1174 Also, any time a failure occurs on the server, the sort order of the servers will be updated so that the one with the fewest consecutive failures is chosen for the next query that goes on the wire, this way bad or non-responsive servers are automatically isolated. 1175 1176 Since the server list is now dynamic, the tracking of query failures per server has been removed and instead is relying on the server sort order as previously described. This simplifies the logic while also reducing the amount of memory required per query. However, because of this dynamic nature, it may not be easy to determine the server attempt order for enqueued queries if there have been any failures. 1177 1178 If using the ARES_OPT_ROTATE, this is now implemented to be a random selection of the configured servers. Since the server list is dynamic, its not possible to go to the next server as configuration could have changed between queries or attempts for the same query. 1179 1180 Finally, this PR moved some existing functions into new files to logically separate them. 1181 1182 This should address issues #550 and #440, while also setting the framework to implement #301. #301 needs a little more effort since it configures things other than the servers themselves (domains, search, sortlist, lookups), which need to make sure they can be safely updated. 1183 1184 Fix By: Brad House (@bradh352) 1185 1186Brad House (1 Nov 2023) 1187- no reason to run LSAN, ASAN already does it 1188 1189GitHub (31 Oct 2023) 1190- [Brad House brought this change] 1191 1192 AppVeyor: update compiler versions, use Msys2, and Windows fixes (#593) 1193 1194 AppVeyor was using Visual Studio 2015 along with old versions of MinGW. Update to the latest AppVeyor provides and also add an MSYS2 build test using MinGW which will use the bleeding edge version. 1195 1196 When researching #590 this also uncovered a bug in cmake not properly detecting if_indextoname() on windows. This has been corrected as well as the underlying issue reported in #590. 1197 1198 Fix By: Brad House (@bradh352) and Jonas Kvinge (@jonaski) 1199 1200Brad House (31 Oct 2023) 1201- Coverage: add some code misuse test cases 1202 1203- hosts file parsing should set success at end of loop 1204 1205- fix windows localhost for ares_gethostbyname_file() when /etc/hosts doesn't have an entry 1206 1207- SonarCloud: fix up codesmells (const, unneeded casts, reduce complexity) 1208 1209GitHub (30 Oct 2023) 1210- [Brad House brought this change] 1211 1212 Replace hosts parser, add caching capabilities (#591) 1213 1214 HOSTS FILE PROCESSING OVERVIEW 1215 ============================== 1216 The hosts file on the system contains static entries to be processed locally 1217 rather than querying the nameserver. Each row is an IP address followed by 1218 a list of space delimited hostnames that match the ip address. This is used 1219 for both forward and reverse lookups. 1220 1221 We are caching the entire parsed hosts file for performance reasons. Some 1222 files may be quite sizable and as per Issue #458 can approach 1/2MB in size, 1223 and the parse overhead on a rapid succession of queries can be quite large. 1224 The entries are stored in forwards and backwards hashtables so we can get 1225 O(1) performance on lookup. The file is cached until the file modification 1226 timestamp changes (or 60s if there is no implemented stat() capability). 1227 1228 The hosts file processing is quite unique. It has to merge all related hosts 1229 and ips into a single entry due to file formatting requirements. For 1230 instance take the below: 1231 ``` 1232 127.0.0.1 localhost.localdomain localhost 1233 ::1 localhost.localdomain localhost 1234 192.168.1.1 host.example.com host 1235 192.168.1.5 host.example.com host 1236 2620:1234::1 host.example.com host6.example.com host6 host 1237 ``` 1238 This will yield 2 entries. 1239 1) ips: `127.0.0.1,::1` 1240 hosts: `localhost.localdomain,localhost` 1241 2) ips: `192.168.1.1,192.168.1.5,2620:1234::1` 1242 hosts: `host.example.com,host,host6.example.com,host6` 1243 1244 It could be argued that if searching for `192.168.1.1` that the `host6` 1245 hostnames should not be returned, but this implementation will return them 1246 since they are related (both ips have the fqdn of host.example.com). It is 1247 unlikely this will matter in the real world. 1248 1249 1250 Fix By: Brad House (@bradh352) 1251 1252- [Brad House brought this change] 1253 1254 cleanups: split functions out into different files, rename some to be more logical (#589) 1255 1256Brad House (27 Oct 2023) 1257- fix comment 1258 1259- recursive git attributes 1260 1261Version 1.21.0 (26 Oct 2023) 1262 1263Brad House (26 Oct 2023) 1264- SonarCloud: reduce reported complexity that exists for no reason. 1265 1266- SonarCloud: fix some #undef codesmells 1267 1268- formatting 1269 1270- document ARES_RR_* records 1271 1272- no reason to limit on truncation 1273 1274- linguist fixes 1275 1276- don't use test cases to determine language of c-ares 1277 1278- fix grammar 1279 1280- fix count 1281 1282GitHub (25 Oct 2023) 1283- [Brad House brought this change] 1284 1285 1.21.0 release prep (#585) 1286 1287Brad House (25 Oct 2023) 1288- fix build warning 1289 1290GitHub (25 Oct 2023) 1291- [Brad House brought this change] 1292 1293 SonarCloud: clean up more codesmells (#584) 1294 1295Brad House (25 Oct 2023) 1296- resolve reported memory leaks 1297 1298- add test vector said to cause a memory leak 1299 1300GitHub (25 Oct 2023) 1301- [Brad House brought this change] 1302 1303 sonarcloud: fix more codesmells (#583) 1304 1305- [Brad House brought this change] 1306 1307 sonarcloud easy codesmells (#582) 1308 1309 Fix By: Brad House (@bradh352) 1310 1311- [Brad House brought this change] 1312 1313 Modernization: replace multiple hand-parsers with new memory-safe parser (#581) 1314 1315 New DNS record parsing code. The old code was basically just some helper macros and functions for parsing an entire DNS message. The caller had to know the RFCs to use the parsers, except for some pre-made exceptions. The new parsing code parses the entire DNS message into an opaque data structure in a memory safe manner with various accessors for reading and manipulating the data. 1316 1317 The existing parser helpers for the various record types were reimplemented as wrappers around the new parser. 1318 1319 The accessors allow easy iteration across the DNS record datastructure, and can be used to easily create dig-like output without needing to know anything about the various record types and formats as dynamic helpers are provided for enumeration of values and data types of those values. 1320 1321 At some point in the future, this new DNS record structure, accessors, and parser will be exposed publicly. This is not done at this point as we don't want to do that until the API is completely stable. Likely a write() function to output the DNS record back into an actual message buffer will be introduced with the stable API as well. 1322 1323 Some subtle bugs in the existing code were uncovered, some which had test cases which turned out to be bogus. Validation with third-party implementations (e.g. BIND9) were performed to validate such cases were indeed bugs. 1324 1325 Adding additional RR parsers such as for TLSA (#470) or SVCB/HTTPS (#566) are trivial now since focus can be put on only parsing the data within the RR, not the entire message. That said, as the new parser is not yet public, it isn't clear the best way to expose any new RRs (probably best to wait for the new parser to be public rather than hacking in another legacy function). 1326 1327 Some additional RRs that are part of DNS RFC1035 or EDNS RFC6891 that didn't have previously implemented parsers are now also implemented (e.g. HINFO, OPT). Any unrecognized RRs are encapsulated into a "RAW_RR" as binary data which can be inserted or extracted, but are otherwise not interpreted in any way. 1328 1329 Fix By: Brad House (@bradh352) 1330 1331- [Gregor Jasny brought this change] 1332 1333 feat: use CMake to control symbol visibility (#574) 1334 1335 In contrast to #572 this solution does not need any extra headers. But it is also limited to GCC-like compilers. 1336 1337 Fix By: Gregor Jasny (@gjasny) 1338 1339- [Brad House brought this change] 1340 1341 remove ares_nowarn helpers #580 1342 1343 Now that the code internally is using proper datatypes, there is no longer a need for ares_nowarn helpers. Remove them. 1344 1345 Fix By: Brad House (@bradh352) 1346 1347Brad House (16 Oct 2023) 1348- clang-format: fix structure alignment 1349 1350 It appears the structure alignment chosen just doesn't work right. 1351 Switch to 'left', it appears to be mostly correct. 1352 1353 Fix By: Brad House (@bradh352) 1354 1355GitHub (15 Oct 2023) 1356- [Brad House brought this change] 1357 1358 Reformat code using clang-format (#579) 1359 1360 c-ares uses multiple code styles, standardize on one. Talking with @bagder he feels strongly about maintaining an 80 column limit, but feels less strongly about things I feel strongly about (like alignment). 1361 1362 Can re-run the formatter on the codebase via: 1363 ``` 1364 clang-format -i */*.c */*.h */*/*.c */*/*.h 1365 ``` 1366 1367 Fix By: Brad House (@bradh352) 1368 1369Brad House (15 Oct 2023) 1370- inet_ntop requires ares_private.h 1371 1372- SonarCloud: Fix additional code smells 1373 1374 Fix By: Brad House (@bradh352) 1375 1376- SonarCloud: Ignore codesmells c89 doesn't support 1377 1378 C89 doesn't support iterator declaration in for loop, kill warning. 1379 1380 Fix By: Brad House (@bradh352) 1381 1382GitHub (15 Oct 2023) 1383- [Brad House brought this change] 1384 1385 set compiler standard to ISO C90/ANSI C89 (#577) 1386 1387 SonarCloud is outputting some code smells for things that aren't possible for C89. Hopefully setting the code standard to C89/C90 properly will fix those bogus warnings. 1388 1389 Fix By: Brad House (@bradh352) 1390 1391Brad House (15 Oct 2023) 1392- fix new ares_strcpy to ensure null termination 1393 1394- build fix 1395 1396GitHub (15 Oct 2023) 1397- [Brad House brought this change] 1398 1399 SonarCloud: Fix up codesmells due to strlen(), strcpy(), and strncpy() (#576) 1400 1401 Create ares_strlen() and ares_strcpy() in order to resolve SonarCloud codesmells related to their use. 1402 1403 ares_strlen() just becomes null-safe. 1404 1405 ares_strcpy() is equivalent to strlcpy(), so unlike strncpy() it guarantees NULL termination. 1406 1407 Fix By: Brad House (@bradh352) 1408 1409Brad House (15 Oct 2023) 1410- SonarCloud: try to appease it better 1411 1412- SonarCloud: Fix reported bugs 1413 1414 SonarCloud reported a few bugs, this commit should fix those reports. 1415 1416 Fix By: Brad House (@bradh352) 1417 1418GitHub (15 Oct 2023) 1419- [Brad House brought this change] 1420 1421 Fix internal datatype usage and warnings (#573) 1422 1423 PR #568 increased the warning levels and c-ares code emitted a bunch of warnings. This PR fixes those warnings and starts transitioning internal data types into more proper forms (e.g. data lengths should be size_t not int). It does, however, have to manually cast back to what the public API needs due to API and ABI compliance (we aren't looking to break integrations, just clean up internals). 1424 1425 Fix By: Brad House (@bradh352) 1426 1427Brad House (15 Oct 2023) 1428- SonarCloud: exclude tests 1429 1430- fix source directories 1431 1432GitHub (15 Oct 2023) 1433- [Brad House brought this change] 1434 1435 Sonarcloud (#575) 1436 1437- [Brad House brought this change] 1438 1439 Increase compiler warnings by default (#568) 1440 1441 c-ares was missing a couple of common compiler warnings during building that are widely recognized as a best practice. This PR makes no code changes, only build system changes to increase warning levels. 1442 1443 This PR does cause some new warnings to be emitted, a follow-up PR will address those. 1444 1445 Fix By: Brad House (@bradh352) 1446 1447- [Brad House brought this change] 1448 1449 introduce ares_bool_t datatype (#570) 1450 1451 c-ares currently uses int for boolean, which can be confusing as there are some functions which return int but use '0' as the success condition. Some internal variable usage is similar. Lets try to identify the boolean use cases and split them out into their own data type of ares_bool_t. Since we're trying to keep C89 compatibility, we can't rely on stdbool.h or the _Bool C99 data type, so we'll define our own. 1452 1453 Also, chose using an enum rather than say unsigned char or int because of the type safety benefits it provides. Compilers should warn if you try to pass, ARES_TRUE on to a ares_status_t enum (or similar) since they are different enums. 1454 1455 Fix By: Brad House (@bradh352) 1456 1457Brad House (12 Oct 2023) 1458- Socket callbacks were passed SOCK_STREAM instead of SOCK_DGRAM on udp 1459 1460 A regression was introduced in 1.20.0 that would pass SOCK_STREAM on udp 1461 connections due to code refactoring. If a client application validated this 1462 data, it could cause issues as seen in gRPC. 1463 1464 Fixes Issue: #571 1465 Fix By: Brad House (@bradh352) 1466 1467- Enhance test of ares_getsock() 1468 1469 In an attempt to see if ares_getsock() was broken as per #571, do 1470 further sanity checks of the results of ares_getsock(). It seems 1471 as though ares_getsock() is fine. 1472 1473 Fix By: Brad House (@bradh352) 1474 1475GitHub (10 Oct 2023) 1476- [Brad House brought this change] 1477 1478 Tool: STAYOPEN flag could make tools not terminate (#569) 1479 1480 If a flag is set to keep the connections to the DNS servers open even if there are no queries, the tools would not exit until the remote server closed the connection due to the user of ares_fds() to determine if there are any active queries. Instead, rely on ares_timeout() returning NULL if there are no active queries (technically this returns the value passed to max_tv in ares_timeout(), but in our use case, that is always NULL). 1481 1482 Fixes Issue: #452 1483 Fix By: Brad House (@bradh352) 1484 1485- [Brad House brought this change] 1486 1487 ares_status_t enum for status codes (#567) 1488 1489 The list of possible error codes in c-ares was a #define list. This not only doesn't provide for any sort of type safety but it also lacks clarification on what a function may return or what it takes, as an int could be an ares status, a boolean, or possibly even a length in the current code. 1490 1491 We are not changing any public APIs as though the C standard states the underlying size and type of an enum is int, there are compiler attributes to override this as well as compiler flags like -fshort-enums. GCC in particular is known to expand an enum's width based on the data values (e.g., it can emit a 64bit integer enum). 1492 1493 All internal usages should be changed by this PR, but of course, there may be some I missed. 1494 1495 Fix By: Brad House (@bradh352) 1496 1497Daniel Stenberg (9 Oct 2023) 1498- docs: provide better man page references 1499 1500 When referring to another c-ares function use \fI function(3) \fP to let 1501 the webpage rendering find and cross-link them appropriately. 1502 1503 SEE ALSO references should be ".BR name (3),", with a space before the 1504 open parenthesis. This helps the manpage to HTML renderer. 1505 1506 Closes #565 1507 1508Version 1.20.1 (8 Oct 2023) 1509 1510GitHub (8 Oct 2023) 1511- [Daniel Stenberg brought this change] 1512 1513 ares-test: silence warning (#564) 1514 1515 warning: comparison of integer expressions of different signedness 1516 1517 Fix By: Daniel Stenberg (@bagder) 1518 1519Brad House (8 Oct 2023) 1520- fix README.md 1521 1522GitHub (8 Oct 2023) 1523- [Brad House brought this change] 1524 1525 1.20.1 release (#563) 1526 1527- [Brad House brought this change] 1528 1529 fix reference to freed memory (#562) 1530 1531 Issue #561 shows free'd memory could be accessed in some error conditions. 1532 1533 Fixes Issue #561 1534 Fix By: Brad House (@bradh352) 1535 1536Brad House (8 Oct 2023) 1537- reported build/test systems may timeout on intensive tests. reduce test case to still be relevant but to reduce false positive errors 1538 1539GitHub (8 Oct 2023) 1540- [Gregor Jasny brought this change] 1541 1542 Regression: Fix typo in fuzzcheck target name (#559) 1543 1544 This seems to be a vim'esque typo introduced with c1b00c41. 1545 1546 Fix By: Gregor Jasny (@gjasny) 1547 1548Version 1.20.0 (6 Oct 2023) 1549 1550Brad House (6 Oct 2023) 1551- fix slist search off by 1 1552 1553GitHub (6 Oct 2023) 1554- [Brad House brought this change] 1555 1556 1.20.0 release prep (#557) 1557 1558- [Brad House brought this change] 1559 1560 ares__buf should return standard error codes. more helpers implemented. (#558) 1561 1562 The purpose of this PR is to hopefully make the private API of this set of routines less likely to need to be changed in a future release. While this is not a public API, it could become harder in the future to change usage as it becomes more widely used within c-ares. 1563 1564 Fix By: Brad House (@bradh352) 1565 1566- [Brad House brought this change] 1567 1568 Update from 1989 MIT license text to modern MIT license text (#556) 1569 1570 ares (and thus c-ares) was originally licensed under the 1989 MIT license text: 1571 https://fedoraproject.org/wiki/Licensing:MIT#Old_Style_(no_advertising_without_permission) 1572 1573 This change updates the license to the modern MIT license as recognized here: 1574 https://opensource.org/license/mit/ 1575 1576 care has been taken to ensure correct attributions remain for the authors contained within the copyright headers, and all authors with attributions in the headers have been contacted for approval regarding the change. Any authors which were not able to be contacted, the original copyright maintains, luckily that exists in only a single file `ares_parse_caa_reply.c` at this time. 1577 1578 Please see PR #556 for the documented approvals by each contributor. 1579 1580 Fix By: Brad House (@bradh352) 1581 1582- [Brad House brought this change] 1583 1584 Test Harness: use ares_timeout() to calculate the value to pass to select() these days. (#555) 1585 1586 The test framework was using 100ms timeout passed to select(), and not using ares_timeout() to calculate the actual recommended value based on the queries in queue. Using ares_timeout() tests the functionality of ares_timeout() itself and will provide more responsive results. 1587 1588 Fix By: Brad House (@bradh352) 1589 1590- [Brad House brought this change] 1591 1592 Fix for TCP back to back queries (#552) 1593 1594 As per #266, TCP queries are basically broken. If we get a partial reply, things just don't work, but unlike UDP, TCP may get fragmented and we need to properly handle that. 1595 1596 I've started creating a basic parser/buffer framework for c-ares for memory safety reasons, but it also helps for things like this where we shouldn't be manually tracking positions and fetching only a couple of bytes at a time from a socket. This parser/buffer will be expanded and used more in the future. 1597 1598 This also resolves #206 by allowing NULL to be specified for some socket callbacks so they will auto-route to the built-in c-ares functions. 1599 1600 Fixes: #206, #266 1601 Fix By: Brad House (@bradh352) 1602 1603- [Brad House brought this change] 1604 1605 remove acountry from built tools as nerd.dk is gone (#554) 1606 1607 The acountry utility required a third party DNSBL service from nerd.dk in order to operate. That service has been offline for about a year and there is no other comparable service offering. We are keeping the code in the repository as an example, but no longer building it. 1608 1609 Fixes: #537 1610 Fix By: Brad House (@bradh352) 1611 1612- [Brad House brought this change] 1613 1614 Don't requeue any queries for getaddrinfo() during destruction. (#553) 1615 1616 During ares_destroy(), any outstanding queries are terminated, however ares_getaddrinfo() had an ordering issue with status codes which in some circumstances could lead to a new query being enqueued rather than honoring the termination. 1617 1618 Fixes #532 1619 Fix By: @Chilledheart and Brad House (@bradh352) 1620 1621- [Brad House brought this change] 1622 1623 ares_getaddrinfo(): Fail faster on AF_UNSPEC if we've already received one address class (#551) 1624 1625 As per #541, when using AF_UNSPEC with ares_getaddrinfo() (and in turn with ares_gethostbynam()) if we receive a successful response for one address class, we should not allow the other address class to continue on with retries, just return the address class we have. 1626 1627 This will limit the overall query time to whatever timeout remains for the pending query for the other address class, it will not, however, terminate the other query as it may still prove to be successful (possibly coming in less than a millisecond later) and we'd want that result still. It just turns off additional error processing to get the result back quicker. 1628 1629 Fixes Bug: #541 1630 Fix By: Brad House (@bradh352) 1631 1632- [Sam Morris brought this change] 1633 1634 Avoid producing an ill-formed result when qualifying a name with the root domain (#546) 1635 1636 This prevents the result of qualifying "name" with "." being "name.." which is ill-formed. 1637 1638 Fixes Bug: #545 1639 Fix By: Sam Morris (@yrro) 1640 1641- [Brad House brought this change] 1642 1643 Configuration option to limit number of UDP queries per ephemeral port (#549) 1644 1645 Add a new ARES_OPT_UDP_MAX_QUERIES option with udp_max_queries parameter that can be passed to ares_init_options(). This value defaults to 0 (unlimited) to maintain existing compatibility, any positive number will cause new UDP ephemeral ports to be created once the threshold is reached, we'll call these 'connections' even though its technically wrong for UDP. 1646 1647 Implementation Details: 1648 * Each server entry in a channel now has a linked-list of connections/ports for udp and tcp. The first connection in the list is the one most likely to be eligible to accept new queries. 1649 * Queries are now tracked by connection rather than by server. 1650 * Every time a query is detached from a connection, the connection that it was attached to will be checked to see if it needs to be cleaned up. 1651 * Insertion, lookup, and searching for connections has been implemented as O(1) complexity so the number of connections will not impact performance. 1652 * Remove is_broken from the server, it appears it would be set and immediately unset, so must have been invalidated via a prior patch. A future patch should probably track consecutive server errors and de-prioritize such servers. The code right now will always try servers in the order of configuration, so a bad server in the list will always be tried and may rely on timeout logic to try the next. 1653 * Various other cleanups to remove code duplication and for clarification. 1654 1655 Fixes Bug: #444 1656 Fix By: Brad House (@bradh352) 1657 1658- [Brad House brought this change] 1659 1660 its not 1991 anymore, lower default timeout and retry count (#542) 1661 1662 A lot of time has passed since the original timeouts and retry counts were chosen. We have on and off issues reported due to this. Even on geostationary satellite links, latency is worst case around 1.5s. This PR changes the per-server timeout to 2s and the retry count lowered from 4 to 3. 1663 1664 Fix By: Brad House (@bradh352) 1665 1666- [Brad House brought this change] 1667 1668 Modernization: Implement base data-structures and replace usage (#540) 1669 1670 c-ares currently lacks modern data structures that can make coding easier and more efficient. This PR implements a new linked list, skip list (sorted linked list), and hashtable implementation that are easy to use and hard to misuse. Though these implementations use more memory allocations than the prior implementation, the ability to more rapidly iterate on the codebase is a bigger win than any marginal performance difference (which is unlikely to be visible, modern systems are much more powerful than when c-ares was initially created). 1671 1672 The data structure implementation favors readability and audit-ability over performance, however using the algorithmically correct data type for the purpose should offset any perceived losses. 1673 1674 The primary motivation for this PR is to facilitate future implementation for Issues #444, #135, #458, and possibly #301 1675 1676 A couple additional notes: 1677 1678 The ares_timeout() function is now O(1) complexity instead of O(n) due to the use of a skiplist. 1679 Some obscure bugs were uncovered which were actually being incorrectly validated in the test cases. These have been addressed in this PR but are not explicitly discussed. 1680 Fixed some dead code warnings in ares_rand for systems that don't need rc4 1681 1682 Fix By: Brad House (@bradh352) 1683 1684- [Jérôme Duval brought this change] 1685 1686 fix missing prefix for CMake generated libcares.pc (#530) 1687 1688 'pkg-config grpc --cflags' complains with: 1689 Variable 'prefix' not defined in libcares.pc 1690 1691 Fix By: Jérôme Duval (@korli) 1692 1693bradh352 (11 Jul 2023) 1694- windows get_DNS_Windows port fix for ipv6 1695 1696- windows get_DNS_Windows port is in network byte order 1697 1698- backoff to debian 11 due to coverage check failure 1699 1700- extend on PR #534, windows should also honor a port 1701 1702GitHub (11 Jul 2023) 1703- [Brad House brought this change] 1704 1705 Support configuration of DNS server ports (#534) 1706 1707 As per https://man.openbsd.org/OpenBSD-5.1/resolv.conf.5 we should 1708 support bracketed syntax for resolv.conf entries to contain an optional 1709 port number. 1710 1711 We also need to utilize this format for configuration of MacOS 1712 DNS servers as seen when using the Viscosity OpenVPN client, where 1713 it starts a private DNS server listening on localhost on a non-standard 1714 port. 1715 1716 Fix By: Brad House (@bradh352) 1717 1718Daniel Stenberg (9 Jun 2023) 1719- provide SPDX identifiers and a REUSE CI job to verify 1720 1721 All files have their licence and copyright information clearly 1722 identifiable. If not in the file header, they are set separately in 1723 .reuse/dep5. 1724 1725 All used license texts are provided in LICENSES/ 1726 1727GitHub (30 May 2023) 1728- [Alexey A Tikhonov brought this change] 1729 1730 Remove unreachable code as reported by Coverity (#527) 1731 1732 Coverity reported some code as unreachable. A manual inspection confirmed the reports. 1733 1734 Fix By: Alexey A Tikhonov (@alexey-tikhonov) 1735 1736- [Ben Noordhuis brought this change] 1737 1738 rand: add support for getrandom() (#526) 1739 1740 glibc provides arc4random_buf() but musl does not and /dev/urandom is 1741 not always available. 1742 1743- [Tim Wojtulewicz brought this change] 1744 1745 Replace uses of sprintf with snprintf (#525) 1746 1747 sprintf isn't safe even if you think you are using it right. Switch to snprintf(). 1748 1749 Fix By: Tim Wojtulewicz (@timwoj) 1750 1751bradh352 (23 May 2023) 1752- update version and release procedure 1753 1754GitHub (22 May 2023) 1755- [Douglas R. Reno brought this change] 1756 1757 INSTALL.md: Add Watcom instructions and update Windows documentation URLs (#524) 1758 1759 This commit adds instructions on how to use the WATCOM compiler to build c-ares. This was just tested on c-ares-1.19.1 and works well. 1760 1761 While going through the links for the C Runtime documentation for Windows systems, I discovered that all three of the KB articles that were linked are now nonexistent. This commit replaces KB94248 with the current replacement available on Microsoft's website, which also makes the other two KB articles obsolete. 1762 1763 Fix By: Douglas R. Reno (@renodr) 1764 1765Version 1.19.1 (22 May 2023) 1766 1767bradh352 (22 May 2023) 1768- Makefile.inc Windows requires tabs not spaces for nmake 1769 1770GitHub (22 May 2023) 1771- [Daniel Stenberg brought this change] 1772 1773 ares_expand_name: fix compiler warnings (#522) 1774 1775 Fix some compiler warnings (not introduced in this release) 1776 1777 Fix By: Daniel Stenberg (@bagder) 1778 1779bradh352 (22 May 2023) 1780- windows MSVC compiler fix on 32bit 1781 1782- update security advisory links 1783 1784- minor CI issues fixes for imported inet_net_pton 1785 1786- ares_rand static analysis fixes from CI 1787 1788- windows build fix 1789 1790- security release notes 1791 1792GitHub (22 May 2023) 1793- [Brad House brought this change] 1794 1795 Merge pull request from GHSA-9g78-jv2r-p7vc 1796 1797- [Brad House brought this change] 1798 1799 Merge pull request from GHSA-x6mf-cxr9-8q6v 1800 1801 * Merged latest OpenBSD changes for inet_net_pton_ipv6() into c-ares. 1802 * Always use our own IP conversion functions now, do not delegate to OS 1803 so we can have consistency in testing and fuzzing. 1804 * Removed bogus test cases that never should have passed. 1805 * Add new test case for crash bug found. 1806 1807 Fix By: Brad House (@bradh352) 1808 1809- [Brad House brought this change] 1810 1811 Merge pull request from GHSA-8r8p-23f3-64c2 1812 1813 * segment random number generation into own file 1814 1815 * abstract random code to make it more modular so we can have multiple backends 1816 1817 * rand: add support for arc4random_buf() and also direct CARES_RANDOM_FILE reading 1818 1819 * autotools: fix detection of arc4random_buf 1820 1821 * rework initial rc4 seed for PRNG as last fallback 1822 1823 * rc4: more proper implementation, simplified for clarity 1824 1825 * clarifications 1826 1827bradh352 (20 May 2023) 1828- add public release note information 1829 1830- bump version to 1.19.1 1831 1832GitHub (6 May 2023) 1833- [Gregor Jasny brought this change] 1834 1835 test: fix warning about uninitialized memory (#515) 1836 1837 fix warning in tests 1838 1839 Fix By: Gregor Jasny (@gjasny) 1840 1841- [lifenjoiner brought this change] 1842 1843 Turn off IPV6_V6ONLY on Windows if it is supported (#520) 1844 1845 Turn off IPV6_V6ONLY on Windows if it is supported, support for IPv4-mapped IPv6 addresses. 1846 1847 IPV6_V6ONLY refs: 1848 https://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses 1849 https://github.com/golang/go/blob/master/src/net/ipsock_posix.go 1850 https://en.wikipedia.org/wiki/Unix-like 1851 off: 1852 https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html#proc-sys-net-ipv6-variables 1853 https://man.netbsd.org/inet6.4 1854 https://man.freebsd.org/cgi/man.cgi?query=inet6 1855 https://github.com/apple-oss-distributions/xnu/blob/main/bsd/man/man4/inet6.4 1856 on: 1857 https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-ipv6-socket-options 1858 acts like off, but returns 1 and dummy setting: 1859 https://man.dragonflybsd.org/?command=inet6 1860 https://man.dragonflybsd.org/?command=ip6 1861 unsupported and read-only returns 1: 1862 https://man.openbsd.org/inet6.4 1863 1864 default value refs: 1865 https://datatracker.ietf.org/doc/html/rfc3493#section-5.3 1866 https://www.kernel.org/doc/html/latest/networking/ip-sysctl.html#proc-sys-net-ipv6-variables 1867 1868- [Brad House brought this change] 1869 1870 Merge pull request from GHSA-54xr-f67r-4pc4 1871 1872 * CARES_RANDOM_FILE should always default to /dev/urandom 1873 1874 During cross-compilation, CARES_RANDOM_FILE may not be able to be appropriately 1875 detected, therefore we should always set it to /dev/urandom and allow the 1876 entity requesting compilation override the value. The code does appropriately 1877 fall back if CARES_RANDOM_FILE cannot be opened. 1878 1879 * use set not option 1880 1881bradh352 (18 Mar 2023) 1882- ares_getaddrinfo using service of "0" should be allowed 1883 1884 As per #517 glibc allows a service/servname of "0" to be treated the 1885 same as if NULL was provided. Also, add a sanity check to ensure 1886 the port number is in range instead of a blind cast. 1887 1888 Fixes: #517 1889 Fix By: Brad House (@bradh352) 1890 1891GitHub (10 Feb 2023) 1892- [Nikolaos Chatzikonstantinou brought this change] 1893 1894 fix memory leak in ares_send (#511) 1895 1896 When the condition channel->nservers < 1 holds, the function returns 1897 prematurely, without deallocating query->tcpbuf. We rearrange the 1898 check to be done prior to the allocations, avoiding the memory 1899 leak. In this way, we also avoid unnecessary allocations if 1900 channel->nservers < 1 holds. 1901 1902 Fix By: Nikolaos Chatzikonstantinou (@createyourpersonalaccount) 1903 1904- [Nikolaos Chatzikonstantinou brought this change] 1905 1906 change comment style to old-style (#513) 1907 1908 Following the README.md guidelines, 1909 1910 "Comments must be written in the old-style" 1911 1912 the comment is changed to the old style. 1913 1914 Fix By: Nikolaos Chatzikonstantinou (@createyourpersonalaccount) 1915 1916- [Nikolaos Chatzikonstantinou brought this change] 1917 1918 use strncasecmp in ares__strsplit (#512) 1919 1920 strncasecmp on platforms that don't already have it is already #define'd to a private implementation. There is no need to have OS-specific logic. Also removes ares__strsplit.h as a header as ares_private.h already includes it. 1921 1922 Fix By: Nikolaos Chatzikonstantinou (@createyourpersonalaccount) 1923 1924- [Yijie Ma brought this change] 1925 1926 Fix a typo in ares_init_options.3 (#510) 1927 1928 that -> than 1929 1930 Fix By: Yijie Ma (@yijiem) 1931 1932- [Douglas R. Reno brought this change] 1933 1934 Watcom Portability Improvements (#509) 1935 1936 - Modify the Watcom Makefile for the source code reorganization (#352) 1937 - Add *.map files into .gitignore 1938 - Fix build errors with Watcom's builtin Windows SDK (which is rather 1939 outdated). It's smart enough to understand Windows Vista, but doesn't 1940 have PMIB_UNICASTIPADDRESS_TABLE or MIB_IPFORWARD_ROW2. 1941 1942 It may be possible to use a different Windows SDK with the Watcom 1943 compiler, such as the most recent Windows 10 SDK. Alternatively the SDK 1944 in OpenWatcom 2.0 (which is in development) should fix this. 1945 1946 I have no problems testing this Makefile prior to releases, just give me 1947 a ping. 1948 1949 Tested with Windows Vista, Windows 7, and Windows 10 using 'adig', 1950 'acountry', and 'ahost'. This also seems to work on Windows XP, though 1951 this is likely due to the compiler in use. 1952 1953 Fix By: Douglas R. Reno (@renodr) 1954 Fixes Bug: #352 1955 1956- [Jay Freeman (saurik) brought this change] 1957 1958 ignore aminclude_static.am, as generated by AX_AM_MACROS_STATIC (#508) 1959 1960 Fix By: Jay Freeman (@saurik) 1961 1962- [Jay Freeman (saurik) brought this change] 1963 1964 sync ax_pthread.m4 with upstream (#507) 1965 1966 The version in the repository is many years old so this PR simply pulls in the latest 1967 available revision from: 1968 http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=tree;f=m4 1969 1970 Fix By: Jay Freeman (@saurik) 1971 1972- [Chilledheart brought this change] 1973 1974 Windows: Invalid stack variable out of scope for HOSTS file path (#502) 1975 1976 In some conditions Windows might try to use a stack address that has gone out of scope when determining where to read the hosts data from for file lookups. 1977 1978 Fix By: @Chilledheart 1979 1980- [Brad House brought this change] 1981 1982 sync ax_cxx_compile_stdcxx_11.m4 with upstream (#505) 1983 1984 It was reported that ax_cxx_compile_stdcxx_11.m4 was not compatible with uclibc. 1985 The version in the repository is many years old so this PR simply pulls in the latest 1986 available revision from: 1987 http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=tree;f=m4 1988 1989 Fixes Bug: #504 1990 Fix By: Brad House (@bradh352) 1991 1992Version 1.19.0 (18 Jan 2023) 1993 1994bradh352 (18 Jan 2023) 1995- Prep for 1.19.0 release 1996 1997- Fix inverted logic in 25523e2 1998 1999 Fix .localhost. handling in prior commit 2000 2001 Fix By: Brad House (@bradh352) 2002 2003- RFC6761 localhost definition includes subdomains 2004 2005 RFC6761 6.3 states: 2006 The domain "localhost." and any names falling within ".localhost." 2007 2008 We were only honoring "localhost". 2009 2010 Fixes: #477 2011 Fix By: Brad House (@bradh352) 2012 2013- docs: ARES_OPT_UDP_PORT and ARES_OPT_TCP_PORT docs wrong byte order 2014 2015 As per #487, documentation states the port should be in network byte 2016 order, but we can see from the test cases using MockServers on 2017 different ports that this is not the case, it is definitely in host 2018 byte order. 2019 2020 Fix By: Brad House (@bradh352) 2021 2022GitHub (18 Jan 2023) 2023- [hopper-vul brought this change] 2024 2025 Add str len check in config_sortlist to avoid stack overflow (#497) 2026 2027 In ares_set_sortlist, it calls config_sortlist(..., sortstr) to parse 2028 the input str and initialize a sortlist configuration. 2029 2030 However, ares_set_sortlist has not any checks about the validity of the input str. 2031 It is very easy to create an arbitrary length stack overflow with the unchecked 2032 `memcpy(ipbuf, str, q-str);` and `memcpy(ipbufpfx, str, q-str);` 2033 statements in the config_sortlist call, which could potentially cause severe 2034 security impact in practical programs. 2035 2036 This commit add necessary check for `ipbuf` and `ipbufpfx` which avoid the 2037 potential stack overflows. 2038 2039 fixes #496 2040 2041 Fix By: @hopper-vul 2042 2043bradh352 (18 Jan 2023) 2044- Fix build due to str-split sed gone wrong 2045 2046 Fix By: Brad House (@bradh352) 2047 2048- cirrus-ci: switch to scan-build-py for MacOS 2049 2050 MacOS seems to work better with scan-build-py 2051 2052 Fix By: Brad House (@bradh352) 2053 2054- ares_strsplit* -> ares__strsplit* to comply with internal function naming 2055 2056 Inspired by #495, but was missing test cases and would failed to build. 2057 2058 Fix By: Brad House (@bradh352), Daniel Stenberg (@bagder) 2059 2060- Cirrus-CI: MacOS Homebrew has changed from /usr/local/opt to /opt/homebrew 2061 2062 Fix paths for homebrew. 2063 2064 Fix By: Brad House (@bradh352) 2065 2066- cirrus-ci: iOS build needs to use ARM MacOS image 2067 2068 CirrusCI removed Intel-based MacOS images. Need to switch 2069 iOS builds to use new ARM images as well. 2070 2071 Fix By: Brad House (@bradh352) 2072 2073- cirrus-ci: new MacOS image 2074 2075 Cirrus-CI has recently EOL'd Intel MacOS VMs, switch to the latest 2076 ARM-based image. 2077 2078 Fix By: Brad House (@bradh352) 2079 2080- acountry was passing stack variable to callback 2081 2082 Recent ASAN versions picked up that acountry was passing stack 2083 variables to ares_gethostbyname() then leaving the stack context. 2084 We will now allocate a buffer for this. 2085 2086 Fix By: Brad House (@bradh352) 2087 2088GitHub (13 Dec 2022) 2089- [Daniel Stenberg brought this change] 2090 2091 docs: reformat/cleanup man pages SYNOPSIS sections (#494) 2092 2093 To make them render "nicer" in both terminals and on the website. 2094 2095 - Removes the bold 2096 - Removes .PP lines 2097 - Indents them more like proper code style 2098 2099 Fix By: Daniel Stenberg (@bagder) 2100 2101- [Nikolaos Chatzikonstantinou brought this change] 2102 2103 bug fix: new ares_strsplit (#492) 2104 2105 * add ares_strsplit unit test 2106 2107 The test reveals a bug in the implementation of ares_strsplit when the 2108 make_set parameter is set to 1, as distinct domains are confused for 2109 equal: 2110 2111 out = ares_strsplit("example.com, example.co", ", ", 1, &n); 2112 2113 evaluates to n = 1 with out = { "example.com" }. 2114 2115 * bugfix and cleanup of ares_strsplit 2116 2117 The purpose of ares_strsplit in c-ares is to split a comma-delimited 2118 string of unique (up to letter case) domains. However, because the 2119 terminating NUL byte was not checked in the substrings when comparing 2120 for uniqueness, the function would sometimes drop domains it should 2121 not. For example, 2122 2123 ares_strsplit("example.com, example.co", ",") 2124 2125 would only result in a single domain "example.com". 2126 2127 Aside from this bugfix, the following cleanup is performed: 2128 2129 1. The tokenization now happens with the help of strcspn instead of the 2130 custom function is_delim. 2131 2. The function list_contains has been inlined. 2132 3. The interface of ares_strsplit has been simplified by removing the 2133 parameter make_set since in practice it was always 1. 2134 4. There are fewer passes over the input string. 2135 5. We resize the table using realloc() down to its minimum size. 2136 6. The docstring of ares_strsplit is updated and also a couple typos 2137 are fixed. 2138 2139 There occurs a single use of ares_strsplit and since the make_set 2140 parameter has been removed, the call in ares_init.c is modified 2141 accordingly. The unit test for ares_strsplit is also updated. 2142 2143 Fix By: Nikolaos Chatzikonstantinou (@createyourpersonalaccount) 2144 2145bradh352 (23 Oct 2022) 2146- CirrusCI: update freebsd image 2147 2148 Old FreeBSD image for CirrusCI has issues with newer symbols, update to later one. 2149 2150 Fix By: Brad House (@bradh352) 2151 2152GitHub (23 Oct 2022) 2153- [Stephen Sachs brought this change] 2154 2155 Fix Intel compiler deprecated options (#485) 2156 2157 Options `-we ###` and `-wd ###` should not include a whitespace. They are also deprecated and `-diag-error` and `-diag-disable` are their replacements. 2158 2159 Intel compiler 2021.6 is not able to be used in configure without the proposed patch. 2160 2161 Fix By: Stephen Sachs (@stephenmsachs) 2162 2163- [Jonathan Ringer brought this change] 2164 2165 Allow for CMake to use absolute install paths (#486) 2166 2167 Generated libcares.pc could have bad paths when using absolute paths. 2168 2169 Fix By: Jonathan Ringer (@jonringer) 2170 2171- [Thomas Dreibholz brought this change] 2172 2173 Fix for issue #488: ensure that the number of iovec entries does not exceed system limits. (#489) 2174 2175 c-ares could try to exceed maximum number of iovec entries supported by system. 2176 2177 Fix By: Thomas Dreibholz (@dreibh) 2178 2179- [bsergean brought this change] 2180 2181 Add include guards to ares_data.h (#491) 2182 2183 All the other header files in the src/lib folder do have an include guard so it look like an overthought. 2184 2185 Fix By: @bsergean 2186 2187- [Brad Spencer brought this change] 2188 2189 Fix typo in docs for ares_process_fd (#490) 2190 2191 A single letter was missing 2192 2193 Fix By: Brad Spencer (@b-spencer) 2194 2195- [lifenjoiner brought this change] 2196 2197 tools: refine help (#481) 2198 2199 fix invalid help options and documentation typos 2200 2201 Fix By: @lifenjoiner 2202 2203- [lifenjoiner brought this change] 2204 2205 Git: ignore CMake temporary files (#480) 2206 2207 exclude more files from git 2208 2209 Fix By: @lifenjoiner 2210 2211- [lifenjoiner brought this change] 2212 2213 adig: fix `-T` option (#479) 2214 2215 Helper was missing flag to enable TCP mode of operation. 2216 2217 Fix By: @lifenjoiner 2218 2219- [Frank brought this change] 2220 2221 Add vcpkg installation instructions (#478) 2222 2223 Update to include vcpkg installation instructions 2224 2225 Fix By: @FrankXie05 2226 2227- [marc-groundctl brought this change] 2228 2229 Convert total timeout to per-query (#467) 2230 2231 On Apple platforms, libresolv reports the total timeout in retrans, not the per-query time. This patch undoes that math to get the per-query time, which is what c-ares expects. This is not perfect because libresolv is inconsistent on whether the timeout is multiplied by retry or retry+1, but I don't see any way to distinguish these cases. 2232 2233 Fix By: Marc Aldorasi (@marc-groundctl) 2234 2235- [marc-groundctl brought this change] 2236 2237 Don't include version info in the static library (#468) 2238 2239 The static library should not contain version info, since it would be linked into an executable or dll with its own version info. 2240 2241 Fix By: @marc-groundctl 2242 2243- [Ridge Kennedy brought this change] 2244 2245 Fix ares_getaddrinfo() numerical address fast path with AF_UNSPEC (#469) 2246 2247 The conversion of numeric IPv4 addresses in fake_addrinfo() is broken when 2248 the family is AF_UNSPEC. The initial call to ares_inet_pton with AF_INET 2249 will succeed, but the subsequent call using AF_INET6 will fail. This results 2250 in the fake_addrinfo() fast path failing, and ares_getaddrinfo() making a 2251 query when none should be required. 2252 2253 Resolve this by only attempting the call to ares_inet_pton with AF_INET6 2254 if the initial call with AF_INET was unsuccessful. 2255 2256 Fix By: Ridge Kennedy (@ridgek) 2257 2258- [Manish Mehra brought this change] 2259 2260 Configurable hosts path for file_lookup (#465) 2261 2262 This changeset adds support for configurable hosts file 2263 ARES_OPT_HOSTS_FILE (similar to ARES_OPT_RESOLVCONF). 2264 2265 Co-authored-by: Manish Mehra (@mmehra) 2266 2267bradh352 (27 Apr 2022) 2268- CMake: Windows DLLs lack version information 2269 2270 The cares.rc was not included in the build for CMake. Conditionally 2271 add it when building for Windows. 2272 2273 Fix By: Brad House (@bradh352) 2274 Fixes Bug: #460 2275 2276GitHub (27 Apr 2022) 2277- [Kai Pastor brought this change] 2278 2279 CMake: Guard target creation in exported config (#464) 2280 2281 User projects may call 'find_package(c-ares)' multiple times (e.g. 2282 via dependencies), but targets must be created only once. 2283 Shared and static target must be treated independently. 2284 2285 Fix By: Kai Pastor (@dg0yt) 2286 2287bradh352 (27 Apr 2022) 2288- Honor valid DNS result even if other class returned an error 2289 2290 When using ares_getaddrinfo() with PF_UNSPEC, if a DNS server returned 2291 good data on an A record, followed by bad data on an AAAA record, the 2292 good record would be thrown away and an error returned. 2293 2294 If we got a good response from one of the two queries, regardless of 2295 the order returned, we should honor that. 2296 2297 Fix By: Dmitry Karpov (dkarpov@roku.com) 2298 Signed Off By: Brad House (@bradh352) 2299 2300GitHub (2 Apr 2022) 2301- [Sam James brought this change] 2302 2303 configure.ac: fix STDC_HEADERS typo (#459) 2304 2305 There is no autoconf macro called STDC_HEADERS. AC_HEADER_STDC however does 2306 exist and it defines the STDC_HEADERS macro for use. 2307 2308 Not clear that STDC_HEADERS from its use in the repo is needed but 2309 would rather not meddle with it for now. 2310 2311 Fixes an annoying warning on `./configure`: 2312 ``` 2313 /var/tmp/portage/net-dns/c-ares-1.18.1/work/c-ares-1.18.1/configure: 24546: STDC_HEADERS: not found 2314 ``` 2315 2316 Signed-off-by: Sam James <sam@gentoo.org> 2317 2318bradh352 (2 Mar 2022) 2319- Asterisks should be allowed in host validation as CNAMEs may reference wildcard domains 2320 2321 CloudFlare appears to use this logic in CNAMEs as per 2322 https://github.com/nodejs/node/issues/42171 2323 2324 Fixes: #457 2325 Fix By: Brad House (@bradh352) 2326 2327- Don't return on file lookup failure, set status 2328 2329 When resolving a host via /etc/hosts, don't return with a predefined 2330 error as there may be other tries. 2331 2332 Fix By: Brad House (@bradh352) 2333 2334- 'localhost' special treatment enhancement 2335 2336 Since localhost is special-cased, any errors should be ignored when 2337 reading /etc/hosts as otherwise we could return an error if there 2338 were for instance an invalidly formatted /etc/hosts or if /etc/hosts 2339 had a permissions error while reading. 2340 2341 This exact behavior appears to have been seen on OS/400 PASE 2342 environments which allows AIX binares to run. 2343 2344 Fix By: Brad House (@bradh352) 2345 2346- If chain building c-ares as part of another project, detect of res_servicename could fail (#451) 2347 2348 If libresolv is already included with the build, c-ares wouldn't properly detect its use. 2349 2350 May fix: #451 2351 Fix by: Brad House (@bradh352) 2352 2353- no analyze capability on ios 2354 2355- attempt to use scan-build on ios 2356 2357- disable tests on ios 2358 2359- fix switch statement 2360 2361- code coverage had gotten disabled 2362 2363- looks like shell expansion doesn't work with cirrus-ci, lets do it another way 2364 2365- attempt to autobuild for iOS 2366 2367GitHub (8 Dec 2021) 2368- [Brad House brought this change] 2369 2370 Windows: rework/simplify initialization code, drop long EOL systems (#445) 2371 2372 There was a lot of windows initialization code specific to the era that predates Windows Vista such as reading DNS configuration from the registry, and dynamically loading libraries to get access to functions that didn't exist in XP or earlier releases. 2373 2374 Vista was released in January 2007, and was EOL'd in 2017, and support for Vista is still maintained with this patch set. 2375 2376 XP was EOL'd in Apr 8 2014. 2377 2378 I believe the last OS based on something earlier than Vista was POSReady 2009, as it was XP based for some reason, and that was EOL'd in January 2019. Considering any POS system falls under the PCI-DSS rules, they aren't allow to run POSReady 2009 any more so there is no reason to try to continue supporting such systems. 2379 2380 We have also targeted with our build system Vista support for the last few years, and while developers could change the target, we haven't had any reports that they have. 2381 2382bradh352 (9 Nov 2021) 2383- Fix memory leak in reading /etc/hosts 2384 2385 When an /etc/hosts lookup is performed, but fails with ENOTFOUND, and 2386 a valid RFC6761 Section 6.3 fallback is performed, it could overwrite 2387 variables that were already set and therefore leave the pointers 2388 dangling, never to be cleaned up. 2389 2390 Clean up explicitly on ENOTFOUND when returning from the file parser. 2391 2392 Fixes: #439 2393 Fix By: Brad House (@bradh352) 2394 2395GitHub (2 Nov 2021) 2396- [Bobby Reynolds brought this change] 2397 2398 Fix cross-compilation from Windows to Linux due to CPACK logic (#436) 2399 2400 When determining value for CPACK_PACKAGE_ARCHITECTURE, prefer to use 2401 value from CMAKE_SYSTEM_PROCESSOR before falling back to uname output. 2402 2403 Additionally, if building from a Windows host, emit a fatal error 2404 instead of attempting to call uname. 2405 2406 Fix By: Bobby Reynolds (@reynoldsbd) 2407 2408bradh352 (1 Nov 2021) 2409- fix coveralls link 2410 2411- coveralls needs token 2412 2413- coveralls appears to require git 2414 2415- fix a couple of coveralls vars 2416 2417- more coveralls fixes 2418 2419- add code coverage libs to LDADD instead of _LIBS 2420 2421- make verbose 2422 2423- try to fix code coverage building 2424 2425- need -y for install 2426 2427- try to fix asan/ubsan/lsan when built with clang. try to support code coverage properly. 2428 2429- try another path 2430 2431- fix pip 2432 2433- attempt to enable some other build types that travis supported 2434 2435Version 1.18.1 (26 Oct 2021) 2436 2437bradh352 (26 Oct 2021) 2438- missed version 2439 2440- 1.18.1 release prep 2441 2442- ares_getaddrinfo() was returning the wrong size for ai_addrlen 2443 2444 ai_addrlen was erroneously returning 16 bytes instead of the 2445 sizeof(struct sockaddr_in6). This is a regression introduced 2446 in 1.18.0. 2447 2448 Reported by: James Brown <jbrown@easypost.com> 2449 Fix By: Brad House (@bradh352) 2450 2451- Windows: autotools force linking to iphlpapi 2452 2453GitHub (26 Oct 2021) 2454- [Gregor Jasny brought this change] 2455 2456 Fix typo detected by lintian (#434) 2457 2458 typo in docs for ares_parse_uri_reply 2459 2460 Fix By: Gregor Jasny (@gjasny) 2461 2462Version 1.18.0 (25 Oct 2021) 2463 2464bradh352 (25 Oct 2021) 2465- replace Travis badge with Cirrus-CI badge 2466 2467- c-ares 1.18.0 release prep 2468 2469GitHub (21 Oct 2021) 2470- [Jérôme Duval brought this change] 2471 2472 Haiku: port (#431) 2473 2474 Port for Haiku. Slight CMake changes, header changes, and resolv.conf/hosts paths specific to Haiku. 2475 2476 Port By: Jérôme Duval (@korli) 2477 2478bradh352 (19 Oct 2021) 2479- valgrind: fix reported invalid read 2480 2481- make sure distcheck runs 2482 2483- detect oddities and skip test if necessary 2484 2485- fix null ptr deref in strlen 2486 2487- bend over backwards for testing file access, something is weird on debian 2488 2489- chmod(fn, 0) is failing on debian 2490 2491- maybe process needs to be called 2492 2493- split test output 2494 2495- clean up a couple of compiler warnings 2496 2497- use helper function for addrinfo to simplify code 2498 2499- INSTANTIATE_TEST_CASE_P -> INSTANTIATE_TEST_SUITE_P as new convention in googletest 2500 2501- gmock: update from 1.8.0 to 1.11.0 2502 2503- Cirrus-CI: fix debian arm build 2504 2505- Cirrus-CI: more updates for proper testing 2506 2507- install proper packages for asan and analyze 2508 2509- fix crash in tests 2510 2511- try to disable container tests 2512 2513- need g++ for tests on debian 2514 2515- try cirrus-ci again 2516 2517- whitespace 2518 2519- start bringing up cirrus-ci 2520 2521- prep for adding new ci 2522 2523- fix cut and paste error 2524 2525GitHub (18 Oct 2021) 2526- [Brad House brought this change] 2527 2528 RFC6761: special case "localhost" (#430) 2529 2530 As per RFC6761 Section 6.3, "localhost" lookups need to be special cased to return loopback addresses, and not forward queries to recursive dns servers. 2531 2532 We first look up via files (/etc/hosts or equivalent), and if that fails, we then attempt a system-specific address enumeration for loopback addresses (currently Windows-only), and finally fallback to ::1 and 127.0.0.1. 2533 2534 Fix By: Brad House (@bradh352) 2535 Fixes Bug: #399 2536 2537- [Brad House brought this change] 2538 2539 Reimplement ares_gethostbyname() by wrapping ares_getaddrinfo() (#428) 2540 2541 ares_gethostbyname() and ares_getaddrinfo() do a lot of similar things, however ares_getaddrinfo() has some desirable behaviors that should be imported into ares_gethostbyname(). For one, it sorts the address lists for the most likely to succeed based on the current system routes. Next, when AF_UNSPEC is specified, it properly handles search lists instead of first searching all of AF_INET6 then AF_INET, since ares_gethostbyname() searches in parallel. Therefore, this PR should also resolve the issues attempted in #94. 2542 2543 A few things this PR does: 2544 2545 1. ares_parse_a_reply() and ares_parse_aaaa_reply() had very similar code to translate struct ares_addrinfo into a struct hostent as well as into struct ares_addrttl/ares_addr6ttl this has been split out into helper functions of ares__addrinfo2hostent() and ares__addrinfo2addrttl() to prevent this duplicative code. 2546 2547 2. ares_getaddrinfo() was apparently never honoring HOSTALIASES, and this was discovered once ares_gethostbyname() was turned into a wrapper, the affected test cases started failing. 2548 2549 3. A slight API modification to save the query hostname into struct ares_addrinfo as the last element of name. Since this is the last element, and all user-level instances of struct ares_addrinfo are allocated internally by c-ares, this is not an ABI-breaking change nor would it impact any API compatibility. This was needed since struct hostent has an h_name element. 2550 2551 4. Test Framework: MockServer tests via TCP would fail if more than 1 request was received at a time which is common when ares_getaddrinfo() queries for both A and AAAA records simultaneously. Infact, this was a long standing issue in which the ares_getaddrinfo() test were bypassing TCP alltogether. This has been corrected, the message is now processed in a loop. 2552 2553 5. Some tests had to be updated for overall correctness as they were invalid but somehow passing prior to this change. 2554 2555 Change By: Brad House (@bradh352) 2556 2557bradh352 (9 Oct 2021) 2558- ares_getaddrinfo() missing sanity check to fix #426 2559 2560- ares_getaddrinfo(): continue to next domain in search if query returns ARES_ENODATA 2561 2562 Some DNS servers may behave badly and return a valid response with no data, in this 2563 case, continue on to the next search domain, but cache the result. 2564 2565 Fixes Bug: #426 2566 Fix By: Brad House (@bradh352) 2567 2568- Allow '/' as a valid character for a returned name 2569 2570 As of c-ares 1.17.2, a CNAME an in-addr.arpa delegation broke due 2571 to not allowing '/'. This needs to be allowed to not break valid 2572 functionality. 2573 2574 Fixes Bug: #427 2575 Reported By: Adrian (@leftshift) 2576 Fix By: Brad House (@bradh352) 2577 2578Daniel Stenberg (5 Oct 2021) 2579- libcares.pc.in: update the URL 2580 2581bradh352 (8 Sep 2021) 2582- ares_expand_name should allow underscores (_) as SRV records legitimately use them 2583 2584 c-ares 1.17.2 introduced response validation to prevent a security issue, however 2585 it did not have (_) listed as a valid character for domain name responses which 2586 caused issues when a CNAME referenced a SRV record which contained underscores. 2587 2588 While RFC2181 section 11 does explicitly state not to do validation, that applies 2589 to servers not clients. 2590 2591 Fixes: #424 2592 Fix By: Brad House (@bradh352) 2593 2594Daniel Stenberg (7 Sep 2021) 2595- domain: update to use c-ares.org 2596 2597 Closes #423 2598 2599- mailing list: moved to lists.haxx.se 2600 2601GitHub (3 Sep 2021) 2602- [Biswapriyo Nath brought this change] 2603 2604 CMake: Fix build in cygwin (#422) 2605 2606 As cygwin environment has both socket.h and winsock2.h headers check WIN32 not to include the later one here 2607 2608 Fix By: Biswapriyo Nath (@Biswa96) 2609 2610bradh352 (23 Aug 2021) 2611- make building more verbose 2612 2613- add appveyor cmake/mingw static-only build 2614 2615GitHub (17 Aug 2021) 2616- [Sinan Kaya brought this change] 2617 2618 CMake: lower case advapi32 for cross-building with mingw (#420) 2619 2620 When cross compiling with yocto's meta-mingw layer, getting a dependency 2621 error. 2622 2623 This is caused by the fact that advapi32 is lower case in mingw builds. 2624 2625 Fix By: Sinan Kaya <sinan.kaya@microsoft.com> 2626 2627bradh352 (17 Aug 2021) 2628- autotools: add ax_check_gnu_make.m4 2629 2630- autotools: add ax_require_defined.m4 2631 2632- autotools: dont use newer AC_CHECK_INCLUDES_DEFAULT, don't quote AC_ERROR_MSG 2633 2634- import more files needed by newer ax_code_coverage.m4 2635 2636- import more files needed by newer ax_code_coverage.m4 2637 2638- work around autoreconf -fiv first call returning 'error: too many loops' 2639 2640- restore zz40-xc-ovr.m4 2641 2642- autotools: processed configure.ac through autoupdate 2643 2644- autotools. update ax_code_coverage.m4 to latest. don't use deprecated AC_HELP_STRING 2645 2646- pull out some old autotools cruft 2647 2648GitHub (17 Aug 2021) 2649- [Felix Yan brought this change] 2650 2651 Provide ares_nameser.h as a public interface (#417) 2652 2653 NodeJS needs ares_nameser.h as a pubic header. 2654 2655 Fixes: #415 2656 Fix By: Felix Yan (@felixonmars) 2657 2658- [Felix Yan brought this change] 2659 2660 Fix building when latest ax_code_coverage.m4 is imported (#418) 2661 2662 ax_code_coverage.m4 dropped the @CODE_COVERAGE_RULES@ macro, so we need to switch to the latest recommendation from the m4 file. This requires updates to Makefile.am. 2663 2664 Fix By: Felix Yan (@felixonmars) 2665 2666bradh352 (12 Aug 2021) 2667- bump version to match current release 2668 2669GitHub (12 Aug 2021) 2670- [dhrumilrana brought this change] 2671 2672 z/OS minor update, add missing semicolon in ares_init.c (#414) 2673 2674 Build fix for z/OS 2675 2676 Fix by: Dhrumil Rana (@dhrumilrana) 2677 2678- [Daniel Bevenius brought this change] 2679 2680 add build to .gitignore (#410) 2681 2682 This commit adds the build directory to be ignored by git. 2683 2684 The motivation for adding this to .gitignore as opposed to 2685 .git/info/exclude is that the CMake example in INSTALL.md uses build 2686 as the name of the directory to be used by CMake. This will cause 2687 git to report build as an untracked file. 2688 2689 Fix By: Daniel Bevenius (@danbev) 2690 2691- [Martin Holeš brought this change] 2692 2693 Add support for URI(Uniform Resource Identifier) records. (#411) 2694 2695 Add ares_parse_uri_reply() for parsing URI DNS replies. 2696 2697 Fix By: Martin Holeš (@martin-256) 2698 2699Daniel Stenberg (10 Aug 2021) 2700- ares_getaddrinfo.3: available since 1.16.0 2701 2702- README.md: use https:// links 2703 2704Version 1.17.2 (24 Jul 2021) 2705 2706bradh352 (24 Jul 2021) 2707- fix typo 2708 2709- prep for 1.17.2 release 2710 2711GitHub (30 Jun 2021) 2712- [jeanpierrecartal brought this change] 2713 2714 Replace strdup() with ares_strdup() (#408) 2715 2716 strdup() is used in src/lib/ares_parse_a_reply.c and src/lib/ares_parse_aaaa_reply.c whereas allocated memory is freed using ares_free(). 2717 2718 Bug: 407 2719 Fix By: Jean-pierre Cartal (@jeanpierrecartal) 2720 2721- [Brad House brought this change] 2722 2723 Validate hostnames in DNS responses and discard from malicious servers (#406) 2724 2725 To prevent possible users having XSS issues due to intentionally malformed DNS replies, validate hostnames returned in responses and return EBADRESP if they are not valid. 2726 2727 It is not clear what legitimate issues this may cause at this point. 2728 2729 Bug Reported By: philipp.jeitner@sit.fraunhofer.de 2730 Fix By: Brad House (@bradh352) 2731 2732bradh352 (11 Jun 2021) 2733- ares_expand_name(): fix formatting and handling of root name response 2734 2735 Fixes issue introduced in prior commit with formatting and handling 2736 of parsing a root name response which should not be escaped. 2737 2738 Fix By: Brad House 2739 2740- ares_expand_name() should escape more characters 2741 2742 RFC1035 5.1 specifies some reserved characters and escaping sequences 2743 that are allowed to be specified. Expand the list of reserved characters 2744 and also escape non-printable characters using the \DDD format as 2745 specified in the RFC. 2746 2747 Bug Reported By: philipp.jeitner@sit.fraunhofer.de 2748 Fix By: Brad House (@bradh352) 2749 2750GitHub (15 Apr 2021) 2751- [HALX99 brought this change] 2752 2753 Fix can't get dns server on macos and ios (#401) 2754 2755 If DNS configuration didn't include search domains on MacOS (or iOS) it would throw an error instead of ignoring. 2756 2757 Fix By: @halx99 2758 2759- [catalinh-bd brought this change] 2760 2761 Bugfix/crash in ares sortaddrinfo (#400) 2762 2763 The bug was generated because there was no check for the number 2764 of items in the list and invalid memory was accesed when the list 2765 was empty. There is a check for null after calling malloc but on 2766 some systems it always returns a valid address for size equals 0. 2767 Relates To: #392, 0903dcecabca283d0fa771632892dc7592b7a66d 2768 2769 Fix By: @catalinh-bd 2770 2771bradh352 (2 Mar 2021) 2772- Null deref if ares_getaddrinfo() is terminated with ares_destroy() 2773 2774 ares_freeaddrinfo() was not checking for a Null ptr during cleanup of 2775 an aborted query. 2776 2777 Once that was resolved it uncovered another possible issue with 2778 multiple simultaneous underlying queries being outstanding and 2779 possibly prematurely cleaning up the handle. 2780 2781 Reported By: Michael Kourlas 2782 Fix By: Brad House (@bradh352) 2783 2784GitHub (18 Feb 2021) 2785- [Brad House brought this change] 2786 2787 CMake: RANDOM_FILE not defined #397 2788 2789 RANDOM_FILE was never defined by cmake, causing RC4 key generation to use the less secure rand() method. 2790 2791 Also, due to clashes with chain-building from other projects (e.g. curl) that may define RANDOM_FILE, this was renamed to CARES_RANDOM_FILE. 2792 2793 This is the proposed change for #396 2794 2795 Fix By: Brad House (@bradh352) 2796 2797- [Anton Danielsson brought this change] 2798 2799 CMake: fix Make install for iOS/MacOS (#395) 2800 2801 INSTALL TARGETS were missing the BUNDLE DESTINATION 2802 2803 Fix By: Anton Danielsson (@anton-danielsson) 2804 2805- [František Dvořák brought this change] 2806 2807 Fix build with autotools out of source tree (#394) 2808 2809 Add missing include directory, which fixes the build with autotools in separated build directory. 2810 2811 Fix By: František Dvořák (@valtri) 2812 2813bradh352 (15 Jan 2021) 2814- fuzzing: HAVE_CONFIG_H may not be defined so cannot include ares_setup.h. Its not needed even though we include ares_nameser.h 2815 2816- remove redundant header checks 2817 2818- properly detect netinet/tcp.h on openbsd 2819 2820- more portability updates 2821 2822- renamed nameser.h to ares_nameser.h requires Makefile.inc update for distributed files 2823 2824- more portability updates 2825 2826- remove bad files 2827 2828- portability updates for test cases 2829 2830- Portability Updates for arpa/nameser.h (#388) 2831 2832 There is too much inconsistency between platforms for arpa/nameser.h and arpa/nameser_compat.h for the way the current files are structured. Still load the respective system files but make our private nameser.h more forgiving. 2833 2834 Fixes: #388 2835 Fix By: Brad House (@bradh352) 2836 2837- ares_parse_ptr_reply() handle NULL for addr/addr_len. Fixes #392 2838 2839 NodeJS passes NULL for addr and 0 for addrlen parameters to ares_parse_ptr_reply(). On systems where malloc(0) returned NULL, this would cause the function to return ARES_ENOMEM, but the cleanup wasn't handled properly and would crash. 2840 2841 This patche fixes that bug, and also hardens ares_free_hostent() to not leak memory during cleanup. 2842 2843 Fixes: #392 2844 Fix By: Brad House (@bradh352) 2845 2846- Define behavior of malloc(0) 2847 2848 Some systems may return either NULL or a valid pointer on malloc(0). c-ares should never call malloc(0) so lets return NULL so we're more likely to find an issue if it were to occur. 2849 2850GitHub (24 Dec 2020) 2851- [dhrumilrana brought this change] 2852 2853 z/OS: port (#390) 2854 2855 Port c-ares to z/OS. 2856 2857 Fix By: Dhrumil Rana (@dhrumilrana) 2858 2859- [vburdo brought this change] 2860 2861 Use unbuffered stdio for /dev/urandom to read only requested data (#391) 2862 2863 Buffered fread() reads 4096 bytes which is completely unnecessary and potentially may cause problems. 2864 I discovered this on private linux configuration where custom /dev/urandom implementation has poor performance. 2865 2866 Fix By: @vburdo 2867 2868- [Jay Freeman (saurik) brought this change] 2869 2870 This relative header #include needs to use quotes. (#386) 2871 2872 Fix By: Jay Freeman (@saurik) 2873 2874bradh352 (23 Nov 2020) 2875- Win32: Fix tools build with autotools static library 2876 When c-ares is being built as static on Win32, CARES_STATICLIB must 2877 be defined, but it wasn't being pulled in for the tools. 2878 2879 Fixes: #384 2880 Fix By: Brad House (@bradh352) 2881 2882- Loosen requirements for static c-ares library when building tests 2883 2884 It appears that when building tests, it would hardcode enabling building 2885 of the c-ares static library. This was probably due to Windows limitations 2886 in symbol visibility. 2887 2888 This change will use the static library if it exists for tests, always. 2889 Otherwise, it will only forcibly enable static libraries for tests on 2890 Windows. 2891 2892 Fixes: #380 2893 Fix By: Brad House (@bradh352) 2894 2895- Remove legacy comment about ahost/acountry/adig targets 2896 2897- Distribute fuzzinput/fuzznames for fuzz tests 2898 2899 The fuzz test files were not being distributed. This doesn't appear to be 2900 a regression, it looks like they have never been distributed. 2901 2902 Fixes: #379 2903 Fix By: Brad House (@bradh352) 2904 2905Version 1.17.1 (19 Nov 2020) 2906 2907GitHub (19 Nov 2020) 2908- [Brad House brought this change] 2909 2910 Travis: add iOS target built with CMake (#378) 2911 2912 Issue #377 suggested that CMake builds for iOS with c-ares were broken. This PR adds an automatic Travis build for iOS CMake. 2913 2914 Fix By: Brad House (@bradh352) 2915 2916bradh352 (18 Nov 2020) 2917- fix build 2918 2919GitHub (18 Nov 2020) 2920- [Fabrice Fontaine brought this change] 2921 2922 External projects were using non-public header ares_dns.h, make public again (#376) 2923 2924 It appears some outside projects were relying on macros in ares_dns.h, even though it doesn't appear that header was ever meant to be public. That said, we don't want to break external integrators so we should distribute this header again. 2925 2926 Fix By: Fabrice Fontaine (@ffontaine) 2927 2928bradh352 (17 Nov 2020) 2929- note that so versioning has moved to configure.ac 2930 2931- note about 1.17.1 2932 2933- fix sed gone wrong 2934 2935GitHub (17 Nov 2020) 2936- [Daniel Stenberg brought this change] 2937 2938 autotools cleanup (#372) 2939 2940 * remove: install-sh mkinstalldirs 2941 2942 They're generated when needed, no need to store in it. 2943 2944 * buildconf: remove custom logic with autoreconf 2945 2946 Fix By: Daniel Stenberg (@bagder) 2947 2948bradh352 (17 Nov 2020) 2949- attempt to fix 1.17.0 release distribution issues 2950 2951Version 1.17.0 (16 Nov 2020) 2952 2953bradh352 (16 Nov 2020) 2954- 1.17.0 release prep 2955 2956- ares_getaddrinfo(): duplicate hints ai_socktype and ai_protocol into output 2957 2958 ai_socktype and ai_protocol were ignored from the hints input. They are now 2959 duplicated into the output as expected. Currently no sanity checks on 2960 proper values are taking place. 2961 2962 Fixes: #317 2963 Fix By: Brad House (@bradh352) 2964 2965- ares_parse_{a,aaaa}_reply could return larger *naddrttls than passed in 2966 2967 If there are more ttls returned than the maximum provided by the requestor, then 2968 the *naddrttls response would be larger than the actual number of elements in 2969 the addrttls array. 2970 2971 This bug could lead to invalid memory accesses in applications using c-ares. 2972 2973 This behavior appeared to break with PR #257 2974 2975 Fixes: #371 2976 Reported By: Momtchil Momtchev (@mmomtchev) 2977 Fix By: Brad House (@bradh352) 2978 2979GitHub (5 Nov 2020) 2980- [Dustin Lundquist brought this change] 2981 2982 docs: ares_set_local_ip4() uses host byte order (#368) 2983 2984 Properly document brain-dead behavior of ares_set_local_ip4() using host byte order instead of expected network byte order. 2985 2986 Fix By: Dustin Lundquist <d.lundquist@tempered.io> 2987 2988- [Łukasz Marszał brought this change] 2989 2990 empty hquery->name could lead to invalid memory access (#367) 2991 2992 If hquery->name is empty (=="\0"), &hquery->name[strlen(hquery->name)-1] would point to "random" place in memory. This is causing some of my address sanitizer tests to fail. 2993 2994 Fix By: Łukasz Marszał (@lmarszal) 2995 2996bradh352 (28 Sep 2020) 2997- Fix OSSFuzz reported issue in CAA reply parsing 2998 2999 OSS-Fuzz is reporting a use-of-uninitialized-value: 3000 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26012 3001 3002 Reported By: David Drysdale (@daviddrysdale) 3003 3004GitHub (26 Sep 2020) 3005- [David Hotham brought this change] 3006 3007 fuzz CAA parsing (#363) 3008 3009 Add fuzz support for CAA parsing 3010 3011 Fix By: David Hotham (@dimbleby) 3012 3013- [Daniela Sonnenschein brought this change] 3014 3015 Allow parsing of CAA Resource Record (#360) 3016 3017 CAA (Certification Authority Authorization) was introduced in RFC 6844. 3018 This has been obsoleted by RFC 8659. This commit added the possibility 3019 to query CAA resource records with adig and adds a parser for CAA 3020 records, that can be used in conjunction with ares_query(3). 3021 3022 Closes Bug: #292 3023 Fix By: Daniela Sonnenschein (@lxdicted) 3024 3025Daniel Stenberg (17 Sep 2020) 3026- docs: remove the html and pdf make targets 3027 3028 They're rarely used in our daily work flow and mostly just add friction, 3029 3030 Closes #362 3031 3032bradh352 (14 Sep 2020) 3033- ares_process needs to always include nameser.h as it has compat 3034 3035- Define T_OPT if system doesn't provide it 3036 3037GitHub (12 Sep 2020) 3038- [Gisle Vanem brought this change] 3039 3040 Change the mailman links (#358) 3041 3042 Links when wrapping become misleading. Insert newline to prevent wrapping. 3043 3044 Fix By: Gisle Vanem (@gvanem) 3045 3046- [Gisle Vanem brought this change] 3047 3048 [adig] Update man-page for the '-x' option (#357) 3049 3050 Fix By: Gisle Vanem (@gvanem) 3051 3052- [Gisle Vanem brought this change] 3053 3054 [adig] add '-x' option. (#356) 3055 3056 Added a 'dig-style' '-x' option. Also support '-xx' for a 3057 IPv6 bit-string PTR query. 3058 3059 Fix By: Gisle Vanem (@gvanem) 3060 3061bradh352 (12 Sep 2020) 3062- fix indentation 3063 3064- ns_t_opt -> T_OPT 3065 3066GitHub (12 Sep 2020) 3067- [Gisle Vanem brought this change] 3068 3069 Fixes for Watt-32 on djgpp + Windows (#355) 3070 3071 No longer any relation to libcurl since '<libcurl-root>/packages/DOS/common.dj' is dropped. 3072 This Makefile.dj has been tested on Win-10 only (using the Windows hosted djgpp cross compiler). 3073 3074 Fix By: Gisle Vanem (@gvanem) 3075 3076- [Gisle Vanem brought this change] 3077 3078 Fixes for Watt-32 on Windows and MSDOS (#354) 3079 3080 Move the prototype to 'ares_private.h'. 3081 3082 Fix By: Gisle Vanem (@gvanem) 3083 3084bradh352 (11 Sep 2020) 3085- update path for include 3086 3087- remove stale information 3088 3089- remove stale information 3090 3091Brad House (9 Sep 2020) 3092- silence compiler warnings 3093 3094- Remove stale msvc files from makefile 3095 3096GitHub (9 Sep 2020) 3097- [Brad House brought this change] 3098 3099 Reorganize source tree (#349) 3100 3101 Originally started by Daniel Stenberg (@bagder) with #123, this patch reorganizes the c-ares source tree to have a more modern layout. It also fixes out of tree builds for autotools, and automatically builds the tests if tests are enabled. All tests are passing which tests each of the supported build systems (autotools, cmake, nmake, mingw gmake). There may be some edge cases that will have to be caught later on for things I'm not aware of. 3102 3103 Fix By: Brad House (@bradh352) 3104 3105Brad House (1 Sep 2020) 3106- remove CURLDEBUG as per #82 3107 3108GitHub (1 Sep 2020) 3109- [Erik Lax brought this change] 3110 3111 Detect remote DNS server does not support EDNS as per RFC 6891 (#244) 3112 3113 EDNS retry should be based on FORMERR returned without an OPT RR record as per https://tools.ietf.org/html/rfc6891#section-7 rather than just treating any unexpected error condition as a reason to disable EDNS on the channel. 3114 3115 Fix By: Erik Lax (@eriklax) 3116 3117Brad House (27 Aug 2020) 3118- Fix for #345, don't use 'true' use 1 3119 3120GitHub (27 Aug 2020) 3121- [Seraphime Kirkovski brought this change] 3122 3123 ares_gethostbyname: Fix AF_UNSPEC support when using an ip address (#204) 3124 3125 fake_hostent() was not supporting AF_UNSPEC, so when an ip address was specified when using AF_UNSPEC it would attempt to do a DNS lookup rather than returning a fake hostent using the ip address. 3126 3127 Fix By: Seraphime Kirkovski (@Seraphime) 3128 3129- [apenn-msft brought this change] 3130 3131 Tests should use dynamic system-assigned ports rather than static port (#346) 3132 3133 The c-ares test suite was hardcoded to use port 5300 (and possibly 5301, 5302) for the test suite. Especially in containers, there may be no guarantee these ports are available and cause tests to fail when they could otherwise succeed. Instead, request the system to assign a port to use dynamically. This is now the default. To override, the test suite still takes the "-p <port>" option as it always has and will honor that. 3134 3135 Fix By: Anthony Penniston (@apenn-msft) 3136 3137Brad House (25 Aug 2020) 3138- Unset members of the addr struct contain garbage values (#343) 3139 3140 When generating the ares_sockaddr data by getaddrinfo() it was only filling 3141 in certain members while leaving others uninitialized. This left garbage 3142 data if a user tried to use the unset values. memset() the ares_sockaddr 3143 to 0 prior to filling in the values to prevent this. 3144 3145 Reported By: @SmorkalovG 3146 Fix By: Brad House (@bradh352) 3147 3148GitHub (24 Aug 2020) 3149- [Jonathan Maye-Hobbs brought this change] 3150 3151 FQDN with trailing period should be queried first with larger ndot value (#345) 3152 3153 If a query is performed for dynamodb.us-east-1.amazonaws.com. with ndots=5, it was attempting to search the search domains rather than just attempting the FQDN that was passed it. This patch now at least attempts the FQDN first. 3154 3155 We may need to determine if we should abort any further searching, however as is probably intended. 3156 3157 Fix by: Jonathan Maye-Hobbs (@wheelpharoah) 3158 3159- [Gisle Vanem brought this change] 3160 3161 Update acountry.c country code list (#341) 3162 3163 Updated country_list[]: 3164 * 2-letter ISO-3166 country-codes. 3165 * Add, rename some names + codes in accordance with latest table at https://en.wikipedia.org/wiki/ISO_3166-1. 3166 3167 Fix By: Gisle Vanem (@gvanem) 3168 3169- [Bulat Gaifullin brought this change] 3170 3171 Test case should honor flag HAVE_WRITEV rather than WIN32 (#344) 3172 3173 Test cases where not honoring the HAVE_WRITEV flag but instead using WIN32 to determine if WRITEV was available or not. This patch fixes that. 3174 3175 Fix By: Bulat Gaifullin (@bgaifullin) 3176 3177Brad House (18 Jul 2020) 3178- Ensure c89 support 3179 3180 A couple of for loops in Mac-specific code were using integer declarations 3181 inside a for loop. Move the declaration to the top of the preceding 3182 code block to retain c89 compliance. 3183 3184 Reported By: Jeffrey Walton 3185 3186GitHub (2 Jul 2020) 3187- [Fionn Fitzmaurice brought this change] 3188 3189 Avoid buffer overflow in RC4 loop comparison (#336) 3190 3191 The rc4 function iterates over a buffer of size buffer_len who's maximum 3192 value is INT_MAX with a counter of type short that is not guaranteed to 3193 have maximum size INT_MAX. 3194 3195 In circumstances where short is narrower than int and where buffer_len 3196 is larger than the maximum value of a short, it may be possible to loop 3197 infinitely as counter will overflow and never be greater than or equal 3198 to buffer_len. 3199 3200 The solution is to make the comparison be between types of equal width. 3201 This commit defines counter as an int. 3202 3203 Fix By: Fionn Fitzmaurice (@fionn) 3204 3205- [anonymoushelpishere brought this change] 3206 3207 Updated help information for adig, acountry, and ahost. (#334) 3208 3209 Provide more descriptive help information for various utilities. 3210 3211 Fix By: @anonymoushelpishere 3212 3213- [lutianxiong brought this change] 3214 3215 avoid read-heap-buffer-overflow (#332) 3216 3217 Fix invalid read in ares_parse_soa_reply.c found during fuzzing 3218 3219 Fixes Bug: #333 3220 Fix By: lutianxiong (@ltx2018) 3221 3222- [Ivan Baidakou brought this change] 3223 3224 Fix: sizeof(sizeof(addr.saX)) -> sizeof(addr.saX) in readaddrinfo (#331) 3225 3226 Looks like a sed-gone-wrong, a sizeof inside of a sizeof. 3227 3228 Fix By: Ivan Baidakou (@basiliscos) 3229 3230Version 1.16.1 (11 May 2020) 3231 3232Brad House (11 May 2020) 3233- c-ares 1.16.1 release prep 3234 3235- update travis to use xcode11.4 3236 3237- Prevent possible double-free in ares_getaddrinfo() if ares_destroy() is called 3238 3239 In the event that ares_destroy() is called prior to ares_getaddrinfo() completing, 3240 it would result in an invalid read and double-free due to calling end_hquery() twice. 3241 3242 Reported By: Jann Horn @ Google Project Zero 3243 3244GitHub (30 Apr 2020) 3245- [shelley vohr brought this change] 3246 3247 fix: windows UNICODE incompatibilities with ares_getaddrinfo (#328) 3248 3249 Fixes the following compatibility issues: 3250 * Use RegQueryValueExA instead of RegQueryValueEx 3251 * Use ExpandEnvironmentStringsA instead of ExpandEnvironmentStrings 3252 * Use RegOpenKeyExA instead of RegOpenKeyExA 3253 * Use GetWindowsDirectoryA instead of GetWindowsDirectoryA 3254 3255 Fix By: Shelley Vohr (@codebytere) 3256 Closes: #327 3257 3258Brad House (13 Apr 2020) 3259- travis: CloudFlare does not allow T_ANY requests, so live tests that use it fail. Disable. 3260 3261- travis: bump macos image to the latest 3262 3263- cast-align warnings are false for struct sockaddr, silence 3264 3265 Create a macro to silence false cast-align warnings when casting 3266 struct sockaddr * to struct sockaddr_in * and struct sockaddr_in6 *. 3267 3268 Fix By: Brad House (@bradh352) 3269 3270- MacOS: Enable libresolv support for retrieving DNS servers like iOS does. 3271 3272GitHub (10 Apr 2020) 3273- [Dmitry Igrishin brought this change] 3274 3275 CMake: Populate the INCLUDE_DIRECTORIES property of installed targets (#323) 3276 3277 Populate the INCLUDE_DIRECTORIES property of installed targets 3278 3279 Fix By: Dmitry Igrishin (@dmitigr) 3280 3281Brad House (10 Apr 2020) 3282- travis: make valgrind use cmake for tests 3283 3284- dont try to use libtool to run valgrind 3285 3286- valgrind requires libtool installed to wrap tests 3287 3288- scan build 7 3289 3290- fix travis live test 3291 3292- add debug for travis 3293 3294- try without sudo 3295 3296- attempt to modernize travis build environment 3297 3298GitHub (6 Apr 2020) 3299- [Teemu R brought this change] 3300 3301 Allow TXT records on CHAOS qclass (#321) 3302 3303 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`. 3304 3305 C-ares was not allowing such use cases. 3306 3307 Fix By: Teemu R. (@rytilahti) 3308 3309Brad House (5 Apr 2020) 3310- Remove warnings from ares_getaddrinfo.3 man page 3311 3312 As reported in #319, non-standard macros of .IN were used. 3313 Replace with .RS/.RE. 3314 3315 Fixes: #319 3316 Fix By: Brad House (@bradh352) 3317 3318- ares_getaddrinfo man page render better for man2html 3319 3320- update man pages to render better for man2html 3321 3322Version 1.16.0 (12 Mar 2020) 3323 3324Brad House (12 Mar 2020) 3325- 1.16.0 release notes draft 3326 3327- attempt to fix double-free introduced in e0517f9 3328 3329GitHub (12 Mar 2020) 3330- [David Drysdale brought this change] 3331 3332 test: fuzzer input triggering double free (#315) 3333 3334 OSS-Fuzz has reported a double-free with the fuzzer input file 3335 included here; run with: 3336 ./test/aresfuzz test/fuzzinput/clusterfuzz-5637790584012800 3337 3338 Bisecting the failure points to commit e0517f97d988 ("Parse SOA records 3339 from ns_t_any response (#103)") 3340 3341- [Brad House brought this change] 3342 3343 CMake: Install Manpages (#314) 3344 3345 CMake wasn't installing manpages. 3346 3347 Fixes #297 3348 Fix By: Brad House (@bradh352) 3349 3350- [Brad House brought this change] 3351 3352 Enable cmake tests for AppVeyor (#313) 3353 3354 Tests require linking against the static library on Windows otherwise the symbols are not exported for internals being tested. 3355 3356 Fix By: Brad House (@bradh352) 3357 3358Brad House (11 Mar 2020) 3359- Add AppVeyor badge 3360 3361- bump c-ares version to 1.16.0. test AppVeyor integration. 3362 3363GitHub (11 Mar 2020) 3364- [Brad House brought this change] 3365 3366 replace all usages of inet_addr() with ares_inet_pton() which is more proper (#312) 3367 3368 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. 3369 3370 Fixes #309 3371 Fix By: Brad House (@bradh352) 3372 3373- [Brad House brought this change] 3374 3375 CMake: Generate WinPDB files during build (#311) 3376 3377 Build and Install PDB (Windows Debug Symbol) files if supported by underlying system. 3378 3379 Also update AppVeyor to test cmake builds. 3380 3381 Fixes #245 3382 Fix By: Piotr Pietraszkiewicz (@ppietrasa) and Brad House (@bradh352) 3383 3384- [Brad House brought this change] 3385 3386 CMake: Rework library function checking (#310) 3387 3388 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. 3389 3390 Wrap with a Macro to change the behavior. 3391 3392 Fixes: #307 3393 Fix By: Brad House (@bradh352) 3394 3395- [Dron Rathore brought this change] 3396 3397 Parse SOA records from ns_t_any response (#103) 3398 3399 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). 3400 3401 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. 3402 3403 Note that asking for T_ANY is generally a bad idea: 3404 - https://blog.cloudflare.com/what-happened-next-the-deprecation-of-any/ 3405 - https://tools.ietf.org/html/draft-ietf-dnsop-refuse-any 3406 3407 Bug: #102 3408 Fix By: Dron Rathore (@DronRathore) 3409 3410- [Stephen Bryant brought this change] 3411 3412 Added CPack functionality for generating RPM or DEB packages (#283) 3413 3414 Added CPack functionality for generating RPM or DEB packages 3415 3416 ie: run `cpack -G RPM` (or "DEB") after building with CMake. 3417 3418 The current configuration creates 3 separate packages for the shared library, 3419 the development files and the tools. 3420 3421 Fix By: Stephen Bryant (@bf-bryants) 3422 3423- [tjwalton brought this change] 3424 3425 ares_gethostbyname: Return ENODATA if no valid A or AAAA record found (#304) 3426 3427 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. 3428 3429 * Return ENODATA if no valid A or AAAA record found 3430 * Fix and update test ParseAReplyNoData. 3431 * Add test for new ENODATA behaviour in ares_gethostbyname. 3432 3433 Fixes Bug #303 3434 Fix By: @tjwalton 3435 3436- [Michal Rostecki brought this change] 3437 3438 test: Separate live tests from SetServers* tests (#299) 3439 3440 Before this change, SetServers, SetServersPorts and SetServersCSV 3441 contained test cases trying to make DNS queries with the google.com 3442 hostname, which requires Internet connectivity. Tests with that 3443 requirement should be defined in the ares-test-live.cc file and contain 3444 "Live" prefix to filter them out with `--gtest_filter=-*.Live*` on 3445 machines without Internet connectivity. 3446 3447 Fix By: Michal Rostecki (@mrostecki) 3448 3449- [Adam Majer brought this change] 3450 3451 Only count valid addresses when response parsing (#302) 3452 3453 When ares_parse_a_reply or ares_parse_aaaa_reply is called in case 3454 where another AAAA and A responses exist, the resulting ares_addrttl 3455 count is invalid and the structure points to gibberish. 3456 3457 This is a regression since 1.15. 3458 3459 Issue: https://github.com/c-ares/c-ares/issues/300 3460 Fix By: Adam Majer (@AdamMajer) 3461 3462Brad House (24 Dec 2019) 3463- [Kyle Edwards brought this change] 3464 3465 CMake: Provide c-ares version in package export file (#296) 3466 3467 The CMake package export file should provide version information. 3468 3469 Fix By: Kyle Edwards (@KyleFromKitware) 3470 3471- [Ben Noordhuis brought this change] 3472 3473 Accept invalid /etc/resolv.conf lookup values, ability to build container tests (#274) 3474 3475 * Add CARES_BUILD_CONTAINER_TESTS CMake option to add ability to build the Linux-only containerized tests. 3476 * Accept invalid /etc/resolv.conf lookup values 3477 3478 Before this commit invalid `lookup` values resulted in c-ares not using 3479 any lookups without any clear indication why. After this commit it uses 3480 the default "fb". 3481 3482 Fix By: Ben Noordhuis (@bnoordhuis) 3483 3484- [Christian Ammer brought this change] 3485 3486 Parallel A and AAAA lookups in `ares_getaddrinfo` (#290) 3487 3488 A and AAAA lookups for ares_getaddrinfo() are now performed in parallel. 3489 3490 For this change `ares_search` was removed from `ares_getaddrinfo`. 3491 Instead `ares_query` in combination with `next_dns_lookup` are 3492 doing the suffix search. 3493 3494 Adding support for `.onion` addresses which are tested by 3495 `TEST_F(DefaultChannelTest, GetAddrinfoOnionDomain)` 3496 3497 Fix By: Christian Ammer (@ChristianAmmer) 3498 3499- [Vy Nguyen brought this change] 3500 3501 Move variables into the block where it is used to avoid unused-vars (#281) 3502 3503 Warning uncovered with [-Werror, -Wunused-variables] 3504 3505 Fix By: Vy Nguyen (@oontvoo) 3506 3507- [Vy Nguyen brought this change] 3508 3509 Rename local macros to avoid conflicting with system ones and remove unsed variables. (Otherwise code will break once compiled with [-Werror,-Wmacro-redefined,-Wunused-variable] ) (#280) 3510 3511 Fix new getaddrinfo code to not redefine macros on some systems. 3512 3513 Fix By: Vy Nguyen (@oontvoo) 3514 3515- [Egor Pugin brought this change] 3516 3517 [ares_getenv] Return NULL in all cases. (#279) 3518 3519 if ares_getenv is defined, it must return a value on all platforms. 3520 3521 Fix By: Egor Pugin (@egorpugin) 3522 3523- [Abhishek Arya brought this change] 3524 3525 Add OSS-Fuzz fuzzing badge (#278) 3526 3527 Adds based on instructions at 3528 https://google.github.io/oss-fuzz/getting-started/new-project-guide/#status-badge 3529 3530 Patch By: Abhishek Arya (@inferno-chromium) 3531 3532- [Peter Eisentraut brought this change] 3533 3534 ares_init_options.3: Fix layout (#275) 3535 3536 7e6af8e inserted the documentation of resolvconf_path in the middle of 3537 the item for ednspsz, leading to broken layout. Fix that. 3538 3539 Fix By: Peter Eisentraut (@petere) 3540 3541- [Gregor Jasny brought this change] 3542 3543 manpages: Fix typos detected by lintian (#269) 3544 3545 3546 Fix By: Gregor Jasny (@gjasny) 3547 3548- [lifenjoiner brought this change] 3549 3550 keep command line usage up to date (#256) 3551 3552 adig and ahost built-in help did not match args taken. 3553 3554 Fix-By: @lifenjoiner 3555 3556- [Dan Noé brought this change] 3557 3558 ares-test.cc: Handle nullptr in AddrInfo ostream. (#268) 3559 3560 The const AddrInfo& argument to operator<< overload for AddrInfo can be 3561 a nullptr unique_ptr. Handle this explicitly by printing {nullptr} if 3562 the rest of the function cannot be safely executed. 3563 3564 Fix-by: Dan Noé <dpn@google.com> 3565 3566- [Dan Noé brought this change] 3567 3568 Add missing limits.h include from ares_getaddrinfo.c (#267) 3569 3570 This files references INT_MAX, but does not include limits.h. This can 3571 cause a build failure on some platforms. Include limits.h if we have it. 3572 3573 Fix-by: Dan Noé <dpn@google.com> 3574 3575- [Andrew Selivanov brought this change] 3576 3577 fix fuzzer docs and add missing getaddrinfo docs (#265) 3578 3579 There is a fix for a bit outdated clang fuzzer docs and ares_getaddrinfo docs. 3580 3581 Fix By: Andrew Selivanov (@ki11roy) 3582 3583- [Andrew Selivanov brought this change] 3584 3585 Fix leak and crash in ares_parse_a/aaaa_reply (#264) 3586 3587 * fix leak if naddress of particular type found 3588 * fix segfault when wanted ttls count lesser than count of result records 3589 * add fuzzer input files that trigger problems (from #263) 3590 3591 Reported-By: David Drysdale (@daviddrysdale) 3592 Fix-By: Andrew Selivanov (@ki11roy) 3593 3594- [Andrew Selivanov brought this change] 3595 3596 fix segfault when parsing wrong type of record (#262) 3597 3598 Fixes segfault when trying to ares_parse_aaaa with AF_INET and vise versa. 3599 3600 Fix By: Andrew Selivanov (@ki11roy) 3601 3602- work around mingw compile failure 3603 3604- c++ requires explicit casts 3605 3606- support EnvValue on Windows by implementing setenv/unsetenv 3607 3608- [Andrew Selivanov brought this change] 3609 3610 getaddrinfo enhancements (#257) 3611 3612 * Service support has been added to getaddrinfo. 3613 * ares_parse_a/aaaa_record now share code with the addrinfo parser. 3614 * Private ares_addrinfo structure with useful extensions such as ttls (including cname ttls), 3615 as well as the ability to list multiple cnames in chain of lookups 3616 3617 Work By: Andrew Selivanov @ki11roy 3618 3619- [Andrew Selivanov brought this change] 3620 3621 fix ares__sortaddrinfo, use wrappers for sock_funcs (#258) 3622 3623 Some socket functions weren't exposed for use by other areas of the library. Expose 3624 those and make use of them in ares__sortaddrinfo(). 3625 3626 Fix By: Andrew Selivanov (@ki11roy) 3627 3628- Fix c89 compilation support broken by .onion rejection changes 3629 3630 Move .onion check lower after all variables have been declared. 3631 3632 Bug: #246 3633 3634- [kedixa brought this change] 3635 3636 getaddrinfo: callback must be called on bad domain (#249) 3637 3638 Due to an order of incrementing the remaining queries and calling ares_query, on a bad domain 3639 the registered callback wouldn't be called. 3640 3641 Bug: #248 3642 Fixed-By: @kedixa 3643 3644- [Darrin W. Cullop brought this change] 3645 3646 Windows ARM/ARM64 requires AdvApi32 (#252) 3647 3648 Fix link issues caused by missing library that appears to only be required on ARM (though 3649 docs don't list this restriction). Doesn't hurt to require it everywhere. 3650 3651 Bug: #251 3652 Fixed-By: Darrin Cullop (@dwcullop) 3653 3654- [kedixa brought this change] 3655 3656 getaddrinfo: avoid infinite loop in case of NXDOMAIN(#240) (#242) 3657 3658 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. 3659 3660 Fix By: @kedixa 3661 3662- Portability fix for ares__sortaddrinfo() 3663 3664 replace uint32_t with unsigned int and socklen_t with ares_socklen_t 3665 3666 By: Brad House 3667 3668- [Khaidi Chu brought this change] 3669 3670 fix: init bufp before reject .onion to make it can be free correctly (#241) 3671 3672 When querying a .onion domain, it returns directly without setting bufp to NULL. A subsequent free() that occurs can cause a segmentation fault. 3673 3674 Fix By: Khaidi Chu (@XadillaX) 3675 3676- [Andrew Selivanov brought this change] 3677 3678 Add ares__sortaddrinfo() to support getaddrinfo() sorted results (#239) 3679 3680 This is a port of RFC 6724 compliant sorting function from Android Bionic project: 3681 https://android.googlesource.com/platform/bionic/+/e919b116d35aa7deb24ddece69c491e24c3b0d6f/libc/netbsd/net/getaddrinfo.c 3682 3683 The latest version is essentially the same, except two additional parameters to test connection with (mark/uid): 3684 https://android.googlesource.com/platform/bionic/+/master/libc/dns/net/getaddrinfo.c 3685 3686 Please note that even that version has some restrictions. It doesn't support some rules from RFC 6724: 3687 3688 Rule 3 (Avoid deprecated addresses) 3689 Rule 4 (Prefer home addresses) 3690 Rule 7 (Prefer native transport) 3691 3692 Submitted By: Andrew Selivanov (@ki11roy) 3693 3694- [Christian Ammer brought this change] 3695 3696 Increase portability of `ares-test-mock-ai.cc` (#235) 3697 3698 * using portable ares_inet_pton and updated includes in ares-test-mock-ai 3699 * forgot to remove deleted ares-test-ai.cc in Makefile.inc 3700 3701 Fix By: Christian Ammer (@ChristianAmmer) 3702 3703- [Fabrice Fontaine brought this change] 3704 3705 m4/xc-cc-check.m4: use XC_CHECK_BUILD_FLAGS (#236) 3706 3707 Use XC_CHECK_BUILD_FLAGS instead of XC_CHECK_USER_FLAGS. 3708 Otherwise it complains of CPPFLAGS in CFLAGS. 3709 [Retrieved from: 3710 https://git.buildroot.net/buildroot/tree/package/c-ares/0001-use_check_build_instead_of_check_user.patch] 3711 3712 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> 3713 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 3714 Submitted by: Fabrice Fontaine 3715 3716- [Christian Ammer brought this change] 3717 3718 Bugfix for `ares_getaddrinfo` and additional unit tests (#234) 3719 3720 This PullRequest fixes a bug in the function add_to_addrinfo which task is to add new addrinfo items to the ai_next linked list. Also additional unit tests for testing ares_getaddrinfo will be added: 3721 3722 Additional mock server test classes (ares-test-mock-ai.cc): 3723 MockTCPChannelTestAI 3724 MockExtraOptsTestAI 3725 MockNoCheckRespChannelTestAI 3726 MockEDNSChannelTestAI 3727 RotateMultiMockTestAI 3728 NoRotateMultiMockTestAI 3729 3730 Additional live tests (ares-test-live-ai.cc): 3731 LiveGetHostByNameV4 3732 LiveGetHostByNameV6 3733 LiveGetHostByNameV4AndV6 3734 3735 Fix By: Christian Ammer (@ChristianAmmer) 3736 3737- [Christian Ammer brought this change] 3738 3739 Remaining queries counter fix, additional unit tests for `ares_getaddrinfo` (#233) 3740 3741 Remaining queries counter fix, added tests (ParallelLookups, 3742 SearchDomains, SearchDomainsServFailOnAAAA). Removed unnecessary 3743 if and commented code in test. 3744 3745 Fix By: Christian Ammer (@ChristianAmmer) 3746 3747- [Christian Ammer brought this change] 3748 3749 Add initial implementation for ares_getaddrinfo (#112) 3750 3751 Initial implementation for ares_getaddrinfo(). It is NOT compliant with RFC6724, though 3752 it is expected to come closer to conformance prior to the next release. 3753 3754 Features not supported include sorted addresses and honoring of service and hints 3755 parameters. 3756 3757 Implementation by: Christian Ammer (@ChristianAmmer) 3758 3759- [Ben Noordhuis brought this change] 3760 3761 test: fix bad expectation in ipv6 localhost test (#227) 3762 3763 The LiveGetLocalhostByAddrV6 test expected to see "localhost" in the 3764 result when doing an address-to-name lookup for ::1 but on my system 3765 that resolves to "ip6-loopback" because of this stanza in /etc/hosts: 3766 3767 $ grep ^::1 /etc/hosts 3768 ::1 ip6-localhost ip6-loopback 3769 3770 Fix By: Ben Noordhuis (@bnoordhuis) 3771 Bug: #85 3772 3773- [Ben Noordhuis brought this change] 3774 3775 ares_version.h: bump version (#230) 3776 3777 Version change not committed from maketgz.sh 3778 3779 Bug: #229 3780 3781Daniel Stenberg (24 Oct 2018) 3782- ares_library_init_android.3: minor syntax edits, fixed AVAILABILITY 3783 3784Version 1.15.0 (23 Oct 2018) 3785 3786Brad House (23 Oct 2018) 3787- last minute 1.15.0 addition 3788 3789- [Ben Noordhuis brought this change] 3790 3791 Report ARES_ENOTFOUND for .onion domain names as per RFC7686. (#228) 3792 3793 Quoting RFC 7686: 3794 3795 Name Resolution APIs and Libraries (...) MUST either respond 3796 to requests for .onion names by resolving them according to 3797 [tor-rendezvous] or by responding with NXDOMAIN. 3798 3799 A legacy client may inadvertently attempt to resolve a .onion 3800 name through the DNS. This causes a disclosure that the client 3801 is attempting to use Tor to reach a specific service. Malicious 3802 resolvers could be engineered to capture and record such leaks, 3803 which might have very adverse consequences for the well-being 3804 of the user. 3805 3806 Bug: #196 3807 Fix By: Ben Noordhuis @bnoordhuis 3808 3809- prepare for c-ares 1.15.0 release 3810 3811- AIX Build Fix 3812 3813 AIX attempts to include both nameser_compat.h and onameser_compat.h. It appears 3814 the proper fix is to define _USE_IRS so that only nameser_compat.h is used. 3815 3816 Bug: #224 3817 Fix By: Brad House (@bradh352) 3818 3819- Fix crash in ares_dup() due to new ARES_OPT_RESOLVCONF 3820 3821 ares_dup() calls ares_init_options() by making its own fake option 3822 mask since the original mask isn't stored but ARES_OPT_RESOLVCONF 3823 was always set, instead of conditionally set. This caused a crash 3824 because ares_strdup() isn't NULL-safe if no custom path was set. 3825 3826 Made ares_dup() set ARES_OPT_RESOLVCONF conditionally. 3827 3828 Fix By: Brad House (@bradh352) 3829 3830- [Sarat Addepalli brought this change] 3831 3832 Add ares_init_options() configurability for path to resolv.conf file 3833 3834 Add resolvconf_path to end of struct ares_options with ARES_OPT_RESOLVCONF option 3835 so on Unix-like systems a custom path can be specified. If no path is specified, 3836 /etc/resolv.conf is used like normal. 3837 3838 Fix By: Sarat Addepalli @SirR4T 3839 Fixes Bug: #220 3840 Review By: Brad House @bradh352 3841 3842- remove stale variables 3843 3844- fix prototype name for ares_strsplit_free() 3845 3846- add missing prototype 3847 3848- simplify ares_strsplit() and create ares_strsplit_free() helper function 3849 3850- missing ares_strsplit.h from HHEADERS for inclusion in distribution 3851 3852- [Ruslan Baratov brought this change] 3853 3854 Add CARES_BUILD_TOOLS CMake option (#214) 3855 3856 Add ability to exclude building of tools (adig, ahost, acountry) in CMake. This should also close #200. 3857 3858 Fix By: Ruslan Baratov (@ruslo) 3859 Bug: #200 3860 3861- [flyingdutchman23 brought this change] 3862 3863 Style. Whitespace cleanup. (#213) 3864 3865 Small whitespace cleanups. 3866 3867 Fix By: @flyingdutchman23 3868 3869- [John Schember brought this change] 3870 3871 Android: Support for domain search suffix (#211) 3872 3873 Fixes issue #207. Uses LinkProperties.getDomains() to get a list of search domains and adds them to the suffix list. This also adds a new helper function to split strings into an array based on multiple delimiters replacing multiple other functions for dealing with string splitting. 3874 3875 Submitter: John Schember (@user-none) 3876 Fixes: #207 3877 Approved-by: Brad House (@bradh352) 3878 3879- [afalin brought this change] 3880 3881 Improve DNS suffixes extracting from WinNT registry (#202) 3882 3883 Join all global and connection specific suffix lists. Use 'HKLM\Software\Policies\Microsoft\Windows NT\DNSClient\SearchList', 'HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\Domain' as global suffix lists. 3884 3885 Fix By: @afalin 3886 3887- Be consistent with indention in CMakeLists.txt 3888 3889 The imported TRANSFORM_MAKEFILE_INC function from curl used space indention 3890 but the rest of the file used tabs. Go ahead and make it tabs for 3891 consistency as well. 3892 3893 Committed By: Brad House 3894 3895- [flyingdutchman23 brought this change] 3896 3897 Fix modern gcc warning: argument to 'sizeof' in 'strncpy' call is the same expression as the source 3898 3899 Silence warning about using src to determine number of bytes to copy. 3900 In this case it doesn't matter whether it is `src` or `dest`. So there 3901 is no functionality change. 3902 3903 Bug: #210 3904 Fix By: @flyingdutchman23 3905 3906- [Andi Schnebinger brought this change] 3907 3908 fix stringop-overflow warning of GCC (#201) 3909 3910 When using a modern GCC to compile c-ares, there is a stringop-overflow warning. 3911 This patch simply silences the false-positive warning, there is no actual code flaw. 3912 3913 Bug: https://github.com/c-ares/c-ares/pull/201 3914 Fixed By: Andi Schnebinger @Iniesta8 3915 3916GitHub (18 May 2018) 3917- [David Drysdale brought this change] 3918 3919 travis: do coverage in "coverage" build (#195) 3920 3921 Fixes #194, a mistake from commit a255081f2c3c ("travis: Only do 3922 coverage/distcheck on normal build") 3923 3924Brad House (17 May 2018) 3925- [Brad Spencer brought this change] 3926 3927 Apply the IPv6 server blacklist to all nameserver sources, not just Windows (#193) 3928 3929 For #164, I mentioned that it seemed like the IPv6 nameserver blacklist should apply to all OSes. In a mailing list post, @bradh352 agreed and suggested that I file a PR to make it so. 3930 3931 This moves the blacklist check from being Windows-specific to being a general feature of config_nameservers(), no matter the nameserver source. It also simplifies the ares_ipv6_server_blacklisted() implementation to not parse and re-parse the blacklisted IPv6 addresses from strings on every check. I think they're almost as easy to read as a sequence of hex bytes in an array initializer, and it's definitely less work on each trip through the code. 3932 3933 Fix By: Brad Spencer @b-spencer 3934 PR: https://github.com/c-ares/c-ares/pull/193 3935 3936- [Brad Spencer brought this change] 3937 3938 Fix warnings emitted by MSVC when using -W4 (#192) 3939 3940 These changes fix a few warnings emitted by recent versions of MSVC when compiling with -W4. Half of the changes are in Windows-specific code, and the other half should be safe no matter the compiler or OS. 3941 3942 The allocation function change is probably the only one that needs explanation. MSVC gives warnings about the function pointers not being stable across DLL boundaries or something to that effect, so for Windows, I've made them be called indirectly, which at least made the compiler happy. I can't say I've tested every linking combination on Windows with them before or after the change, but it seems harmless. 3943 3944 Fix By: Brad Spencer @b-spencer 3945 PR: https://github.com/c-ares/c-ares/pull/192 3946 3947- [David Hotham brought this change] 3948 3949 Prevent changing name servers while queries are outstanding (#191) 3950 3951 Changing name servers doesn't work, per #41. Better to return an error code than to crash. 3952 3953 Fix-by: David Hotham @dimbleby 3954 3955David Drysdale (15 May 2018) 3956- [Tobias Nießen brought this change] 3957 3958 Fix comment in ares_rules.h (#189) 3959 3960Brad House (6 May 2018) 3961- [Brad Spencer brought this change] 3962 3963 Harden and rationalize c-ares timeout computation (#187) 3964 3965 * Harden and rationalize c-ares timeout computation 3966 * Remove the rand() part of the timeout calculation completely. 3967 3968 When c-ares sends a DNS query, it computes the timeout for that request as follows: 3969 3970 timeplus = channel->timeout << (query->try_count / channel->nservers); 3971 timeplus = (timeplus * (9 + (rand () & 7))) / 16; 3972 I see two issues with this code. Firstly, when either try_count or channel->timeout are large enough, this can end up as an illegal shift. 3973 3974 Secondly, the algorithm for adding the random timeout (added in 2009) is surprising. The original commit that introduced this algorithm says it was done to avoid a "packet storm". But, the algorithm appears to only reduce the timeout by an amount proportional to the scaled timeout's magnitude. It isn't clear to me that, for example, cutting a 30 second timeout almost in half to roughly 17 seconds is appropriate. Even with the default timeout of 5000 ms, this algorithm computes values between 2812 ms and 5000 ms, which is enough to cause a slightly latent DNS response to get spuriously dropped. 3975 3976 If preventing the timers from all expiring at the same time really is desirable, then it seems better to extend the timeout by a small factor so that the application gets at least the timeout it asked for, and maybe a little more. In my experience, this is common practice for timeouts: applications expect that a timeout will happen at or after the designated time (but not before), allowing for delay in detecting and reporting the timeout. Furthermore, it seems like the timeout shouldn't be extended by very much (we don't want a 30 second timeout changing into a 45 second timeout, either). 3977 3978 Consider also the documentation of channel->timeout in ares_init_options(): 3979 3980 The number of milliseconds each name server is given to respond to a query on the first try. (After the first try, the timeout algorithm becomes more complicated, but scales linearly with the value of timeout.) The default is five seconds. 3981 3982 In the current implementation, even the first try does not use the value that the user supplies; it will use anywhere between 56% and 100% of that value. 3983 3984 The attached patch attempts to address all of these concerns without trying to make the algorithm much more sophisticated. After performing a safe shift, this patch simply adds a small random timeout to the computed value of between 0 ms and 511 ms. I could see limiting the random amount to be no greater than a proportion of the configured magnitude, but I can't see scaling the random with the overall computed timeout. As far as I understand, the goal is just to schedule retries "not at the same exact time", so a small difference seems sufficient. 3985 3986 UPDATE: randomization removed. 3987 3988 Closes PR #187 3989 Fix by: Brad Spencer 3990 3991- distribute ares_android.h 3992 3993 Distribute ares_android.h when a release distribution package is 3994 created. 3995 3996 Reported By: Andrey Khranovsky 3997 Bug: https://c-ares.haxx.se/mail/c-ares-archive-2018-04/0000.shtml 3998 3999- ares_set_servers_csv() on failure should not leave channel in a bad state 4000 4001 If bad data is passed to ares_set_servers_csv() or 4002 ares_set_servers_ports_csv() it will clear the existing channel 4003 configured DNS servers, then a call to ares_send() will fail due 4004 to a bad malloc which may have undefined behavior. 4005 4006 The fix now only clears existing servers on success. An additional 4007 sanity check was added in ares_send() to ensure nservers >= 1 or 4008 will result in ARES_ESERVFAIL. 4009 4010 Bug: https://c-ares.haxx.se/mail/c-ares-archive-2018-03/0000.shtml 4011 Reported-by: Francisco Sedano Crippa 4012 4013- docs: Not all manpages are listed 4014 4015 Some docs aren't installed or not showing up on 4016 https://c-ares.haxx.se/docs.html 4017 due to not being listed in Makefile.inc. Add missing docs and 4018 ensure docs are alphabetized. 4019 4020Version 1.14.0 (16 Feb 2018) 4021 4022Daniel Stenberg (16 Feb 2018) 4023- ares_android.c: fix warning: ISO C forbids an empty translation unit 4024 4025- RELEASE-NOTES: some more work we did and people who helped 4026 4027Brad House (16 Feb 2018) 4028- travis: skip Autotools style testing for cmake 4029 4030 Fix cmake test build by skipping autotools portion of test script. 4031 4032- travis: standardize CMake test off of Autotools tests 4033 4034 Instead of running 'make test', run the tests directly like autotools 4035 does. It provides more verbose output. 4036 4037- travis: Enable building tests for CMake 4038 4039 Travis should auto-build and run tests for cmake builds now that 4040 PR #168 is merged. 4041 4042- fix version in pkgconfig 4043 4044- Add version update to CMakeLists in maketgz 4045 4046- Release prep. Add support for pkgconfig in cmake, set versions appropriately 4047 4048Gregor Jasny (15 Feb 2018) 4049- CMake: Add tests 4050 4051Brad House (14 Feb 2018) 4052- [Gregor Jasny brought this change] 4053 4054 Use cmake3 package provided by Ubuntu (#182) 4055 4056- Cmake 3.1 instead of 3.2.1 should be the minimum 4057 4058- Update RELEASE-NOTES and RELEASE-PROCEDURE.md to prepare for next release 4059 4060- get rid of c++ style comments 4061 4062- Use trusty for all builds, precise is EOL. Update clang and cmake versions. 4063 4064- Current CMakeLists.txt doesn't support 2.8.12 anymore, we need to bump the version to 3.2.1 minimum 4065 4066- Re-organize sections in INSTALL.md and add CMake section 4067 4068- [Sergey Kolomenkin brought this change] 4069 4070 remove compilation warnings in MSVC (#47) 4071 4072- document handling of timeouts for ares_process and ares_process_fd to close PR #57 4073 4074- As per Issue #155, since we do not require gethostname() during init, if it fails, there's no reason for init to fail as it is only used to populate the domain 4075 4076GitHub (7 Feb 2018) 4077- [David Drysdale brought this change] 4078 4079 Document WSAStartup requirement (#180) 4080 4081David Drysdale (6 Feb 2018) 4082- [Antonio Tajuelo brought this change] 4083 4084 Added coderelease.io badge to readme.md for letting people subscribe to new versions (#174) 4085 4086- [Sheel Bedi brought this change] 4087 4088 Update year in LICENSE.md to 2018 (#170) 4089 4090GitHub (4 Feb 2018) 4091- [David Drysdale brought this change] 4092 4093 travis: use VM not container for {L,A}SAN builds (#177) 4094 4095 As per https://github.com/travis-ci/travis-ci/issues/9033, container 4096 based builds do not currently allow ptrace, which is used by LSAN and 4097 ASAN. 4098 4099Brad House (3 Feb 2018) 4100- [acthompson-google-com brought this change] 4101 4102 Android JNI code leaks local references in some cases (#175) 4103 4104 * Add Google LLC to AUTHORS. 4105 4106 * android: Explicitly delete all JNI local references, and cache JNI method IDs at initialization. 4107 4108 * android: Only return ARES_ENOTINITIALIZED on failures in initialization code. 4109 4110Gregor Jasny (2 Jan 2018) 4111- Embed fused Google Test 1.8.0 4112 4113Brad House (21 Dec 2017) 4114- [John Schember brought this change] 4115 4116 android: Check returns for obj and classes are not NULL. Document API levels for various Android functions and objects used. (#166) 4117 4118- CARES_CHECK_TYPE should reference variable so a warning is not produced for -Werror compatibility 4119 4120- [Brad Spencer brought this change] 4121 4122 Fix computation of IPv6 blacklist mask for values of netmask > 8. (#164) 4123 4124David Drysdale (14 Dec 2017) 4125- travis: Only do coverage/distcheck on normal build 4126 4127- travis: only do pip install on Linux 4128 4129- travis: only test in IPv4 mode 4130 4131 Travis' Trusty environment does not support IPv6. 4132 4133- test: allow restriction to one IP address family 4134 4135- [Roman Teterin brought this change] 4136 4137 Fix a typo in init_by_resolv_conf (#160) 4138 4139Brad House (11 Dec 2017) 4140- @gvanem says MSVC -RTCc option fails, looks erroneous to me, but the additional mask is harmless 4141 4142- Fix some other mingw warnings 4143 4144- Issue #143, get rid of windows build warning due to passing 'char **' to argument expecting 'const char **' 4145 4146- [Gregor Jasny brought this change] 4147 4148 Distribute CMake files (#130) 4149 4150- Android variants may not have __system_property_get 4151 4152 Some android systems like ARM64 may not have the __system_property_get 4153 symbol in libc (but still have it in the public headers). Detect this 4154 condition at build time. The __system_property_get method of retrieving 4155 name servers is deprecated as of Oreo so should strictly be a fallback 4156 mechanism anyhow. 4157 4158David Drysdale (9 Nov 2017) 4159- [David Hotham brought this change] 4160 4161 Wrong function name throughout man page (#154) 4162 4163- ares_data.c: iterate through substructs when freeing 4164 4165 Previous code recursed into substructures, which makes it more likely 4166 that large/heavily-nested responses could use up lots of stack. 4167 4168- test: test ares_free_data on long chain of structs 4169 4170- [Felix Yan brought this change] 4171 4172 Fix a typo in inet_ntop.c (#151) 4173 4174Daniel Stenberg (29 Sep 2017) 4175- ares_gethostbyname.3: fix callback status values 4176 4177 - ARES_ENOTFOUND means the _name_ wasn't found 4178 4179 - ARES_ENODATA can be returned when a resolve fails 4180 4181 Reported-by: Jakub Hrozek 4182 Bug: https://c-ares.haxx.se/mail/c-ares-archive-2011-06/0012.shtml 4183 4184Brad House (28 Sep 2017) 4185- [John Schember brought this change] 4186 4187 Fix DNS server lookup breaking with Android O due to Android removing access to net.dns# system properties. (#148) 4188 4189 As of Android 8 (Oreo) access to net.dns# has been removed (https://developer.android.com/about/versions/oreo/android-8.0-changes.html). The reasoning given is that it, "improves privacy on the platform". Currently c-ares uses this to get the list of DNS servers. 4190 4191 Now the only way to access the DNS server list is by using the Connectivity Manager though Java. This adds the necessary JNI code to use the Connectivity Manager and pull the DNS server list. The old way using __system_property_get with net.dns# remains for compatibilty. 4192 4193 Using the Connectivity Manager requires the ACCESS_NETWORK_STATE permission to be set on the app. Existing applications most likely are not setting this and keeping the previous method as a fallback will at the very least ensure those apps don't break on older versions of Android. They will need to add this permission for Android 8 compatibility. 4194 4195 Included in the patch are two initalization functions which are required. The JVM must be registered as well as the Connectivity Manager itself. There is no way to get the Connectivity Manager except though Java. Either being passed down to C directly or by passing in an Android Context which can be used to get the Connectivity Manager. Examples are provided in the documentation. 4196 4197- [Konstantinos Sofokleous brought this change] 4198 4199 allow linking against the static msvc runtime library (#133) 4200 4201 allow linking against the static msvc runtime library 4202 4203- [Gergely Nagy brought this change] 4204 4205 Force using the ANSI versions of WinAPI functions (#142) 4206 4207 When compiling c-ares with a build system that defines UNICODE, 4208 bad versions of WinAPI functions are used causing failures or even 4209 crashes. When windows.h is included in MBCS mode (like in the default 4210 build system), the ..A versions are the same as using the one without 4211 any suffix. 4212 4213- [cmake] build fix on Solaris 4214 4215GitHub (11 Sep 2017) 4216- [Brad House brought this change] 4217 4218 Win32 exclude legacy ipv6 subnets (#144) 4219 4220 win32 ipv6: add infrastructure to exclude ipv6 subnets that are known to cause issues 4221 4222- [David Drysdale brought this change] 4223 4224 windows: only look for ancient compilers (#146) 4225 4226 Also drop the use of a versioned output directory; just use 4227 .\msvc 4228 4229- [David Drysdale brought this change] 4230 4231 ares_init_options.3: match up sock_state_cb args (#141) 4232 4233 Fixes #140 4234 4235Daniel Stenberg (25 Aug 2017) 4236- [Anna Henningsen brought this change] 4237 4238 gethostbyaddr: fail with `ECANCELLED` for `ares_cancel()` 4239 4240 When `ares_cancel()` was invoked, `ares_gethostbyaddr()` 4241 queries would fail with `ENOTFOUND` instead of `ECANCELLED`. 4242 4243 It seems appropriate to treat `ares_cancel()` like `ares_destroy()`, 4244 but I would appreciate review of the correctness of this change. 4245 4246 Ref: https://github.com/nodejs/node/issues/14814 4247 4248 Closes #138 4249 4250David Drysdale (18 Aug 2017) 4251- [David Hotham brought this change] 4252 4253 support most recent Visual Studio 2017 4254 4255Brad House (26 Jul 2017) 4256- Preserve original DNS server order on Windows for equal metrics. 4257 4258 qsort is not stable, in order to make it stable we need to record 4259 the original index and add it as a secondary sort value when the 4260 metrics are equal to prevent using DNS servers that may not work 4261 at all as reported by some users. 4262 4263David Drysdale (15 Jul 2017) 4264- [Anna Henningsen brought this change] 4265 4266 ares_parse_naptr_reply: make buffer length check more accurate 4267 4268 9478908a490a6bf009ba58d81de8c1d06d50a117 introduced a length check 4269 for records parsed by `ares_parse_naptr_reply()`. However, that 4270 function is designed to parse replies which also contain non-NAPTR 4271 records; for A records, the `rr_len > 7` check will fail as there 4272 are only 4 bytes of payload. 4273 In particular, parsing ANY replies for NAPTR records was broken 4274 by that patch. 4275 4276 Fix that by moving the check into the case in which it is already 4277 known that the record is a NAPTR record. 4278 4279- appveyor: run dnsdump as a sanity check 4280 4281- travis: run dnsdump as a sanity check 4282 4283- test: use ares_free_string() throughout 4284 4285 As pointed out by Gisle Vanem in #125. 4286 4287Daniel Stenberg (3 Jul 2017) 4288- RELEASE-PROCEDURE.md: how to release 4289 4290 Fixes #115 4291 Closes #116 4292 4293David Drysdale (2 Jul 2017) 4294- test: Build dnsdump on Windows too 4295 4296 Thanks to Gisle Vanem for showing the way: 4297 https://github.com/c-ares/c-ares/commit/b701af8a24cf9d173b1dbe5faedcea34642e92da#commitcomment-22830845 4298 4299Brad House (26 Jun 2017) 4300- [Christian Ammer brought this change] 4301 4302 fix statement like #define - ares ssize_t define had a trailing semicolon (#120) 4303 4304David Drysdale (21 Jun 2017) 4305- test: distribute the fuzzcheck.sh script 4306 4307 The TESTS target runs fuzzcheck.sh so make sure it is included 4308 in the distributed tarball. 4309 4310 (The test itself will be pointless when run on a distribution, because 4311 the fuzzing corpus directories are not shipped, but at least this 4312 means that `make -C test test` should work.) 4313 4314- test: run the name-parsing corpus check too 4315 4316Daniel Stenberg (21 Jun 2017) 4317- dist: don't build/ship PDF versions in release archives 4318 4319 ... experience says very few read them and they can still get build by 4320 those who want them.a 4321 4322- ares_version.h: bump version 4323 4324Version 1.13.0 (20 Jun 2017) 4325 4326Daniel Stenberg (20 Jun 2017) 4327- RELEASE-NOTES: 1.13.0 4328 4329- ares_set_socket_functions.3: added in 1.13.0 4330 4331David Drysdale (18 Jun 2017) 4332- ares_parse_naptr_reply: check sufficient data 4333 4334 Check that there is enough data for the required elements 4335 of an NAPTR record (2 int16, 3 bytes for string lengths) 4336 before processing a record. 4337 4338- test: Feed in short NAPTR 4339 4340- test: Add fuzz input with short NAPTR 4341 4342- test: add ares_parse_naptr_reply to fuzzer 4343 4344- [noiz brought this change] 4345 4346 Update ares.h to support compiling with QNX 4347 4348- [Dionna Glaze brought this change] 4349 4350 Simple changes to appease stricter compilers. 4351 4352 ares_process.c uses htonl, which needs <arpa/inet.h> included. 4353 ares_getnameinfo.c uses a dynamically selected format string for 4354 sprintf, which -Wformat-literal doesn't like. Usually one would use 4355 inttypes.h and a format string "%" PRIu32, but C99 is too new for some 4356 supported platforms. 4357 4358GitHub (16 Jun 2017) 4359- [Gregor Jasny brought this change] 4360 4361 CMake: Emulate interface library on import (#108) 4362 4363 Closes: #104 4364 Signed-off-by: Gregor Jasny <gjasny@googlemail.com> 4365 4366Brad House (6 Jun 2017) 4367- [ChristianAmmer brought this change] 4368 4369 Added support for Windows DNS Suffix Search List (#93) 4370 4371 This change solves issue #53. 4372 4373 Support for suffix search lists was already built in for Linux. The search list could be set via set_search. With this change the suffix search list from Windows is read from the registry and then set into the ares configuration via set_search. There are two sources for the search list: 4374 4375 The global DNS suffix search list. 4376 The primary and connection specific DNS suffixes if the global is not available. 4377 4378 Contributed by @ChristianAmmer 4379 4380Daniel Stenberg (25 May 2017) 4381- [Thomas Köckerbauer brought this change] 4382 4383 configure: do not heck for ar if specified manually 4384 4385 Closes #62 4386 4387David Drysdale (23 May 2017) 4388- ares_expand_name: limit number of indirections 4389 4390- test: fuzz input file that takes a while to process 4391 4392- test: copy data in fuzz regression driver 4393 4394 Oops. 4395 4396GitHub (23 May 2017) 4397- [David Drysdale brought this change] 4398 4399 Convert char from ISO-8859-1 to UTF-8 (#99) 4400 4401 Fixes #97 4402 4403- [Gregor Jasny brought this change] 4404 4405 travis: Use trusty for cmake builds (#109) 4406 4407 kubuntu-backports dropped the CMake package for Precise 4408 4409David Drysdale (2 May 2017) 4410- [David Hotham brought this change] 4411 4412 msvc_ver.inc support most recent Visual Studio 2017 (#101) 4413 4414- test: use io.h not unistd.h for Windows 4415 4416- test: try building fuzz binaries on Windows 4417 4418- test: stick to int in ares-fuzz.c 4419 4420 Using int rather than ares_ssize_t means this file 4421 needs no c-ares dependency - it's a general driver for 4422 any libFuzzer-style entrypoint. 4423 4424- test: force ARES_OPT_NOROTATE for no-rotate tests 4425 4426- test: check expected NOROTATE value 4427 4428- ares_create_query: use ares_free not naked free 4429 4430 Accidentally added in commit 65c71be1cbe5 4431 ("ares_create_query: avoid single-byte buffer overwrite") 4432 4433Brad House (17 Mar 2017) 4434- Need ares.h for ares_ssize_t 4435 4436- tests should not use ssize_t, use ares_ssize_t 4437 4438GitHub (16 Mar 2017) 4439- [Brad House brought this change] 4440 4441 Portability updates for legacy systems. (#92) 4442 4443 Socklen_t should not be used in code, instead ares_socklen_t should be used. 4444 Convert ssize_t to ares_ssize_t for portability since the public API now exposes this. 4445 4446David Drysdale (14 Mar 2017) 4447- [Michael Osei brought this change] 4448 4449 Update msvc_ver.inc (#91) 4450 4451 For Visual Studio 2017 builds 4452 4453Daniel Stenberg (13 Mar 2017) 4454- [Brad House brought this change] 4455 4456 Windows DNS server sorting (#81) 4457 4458 Original Patch From Brad Spencer: 4459 https://c-ares.haxx.se/mail/c-ares-archive-2016-04/0000.shtml 4460 4461 My modifications include: 4462 * Dynamically find GetBestRoute2 since it is a Windows Vista+ symbol, and will fall back to prior behavior when not available. 4463 * Prefer get_DNS_AdaptersAddresses as the modifications should alleviate the concerns which caused us to prefer get_DNS_NetworkParams 4464 * Update AppVeyor to use MinGW-w64 instead of the legacy MinGW 4465 * Fix compile error in test suite for Windows. 4466 4467 Original message from patch below: 4468 4469 From: Brad Spencer <bspencer@blackberry.com> 4470 Date: Fri, 29 Apr 2016 14:26:23 -0300 4471 4472 On Windows, the c-ares DNS resolver tries first to get a full list of 4473 DNS server addresses by enumerating the system's IPv4/v6 interfaces and 4474 then getting the per-interface DNS server lists from those interfaces 4475 and joining them together. The OS, at least in the way the c-ares 4476 prefers to query them (which also may be the only or best way in some 4477 environments), does not provide a unified list of DNS servers ordered 4478 according to "current network conditions". Currently, c-ares will then 4479 try to use them in whatever order the nested enumeration produces, which 4480 may result in DNS requests being sent to servers on one interface 4481 (hosting the current default route, for example) that are only intended 4482 to be used via another interface (intended to be used when the first 4483 interface is not available, for example). This, in turn, can lead to 4484 spurious failures and timeouts simply because of the server address 4485 order that resulted because of the enumeration process. 4486 4487 This patch makes the (safe?) assumption that there is no other better 4488 rule to chose which interface's DNS server list should be prioritized. 4489 After all, a DNS lookup isn't something "per network"; applications 4490 don't look up "these DNS names on this interface and those DNS names on 4491 that interface". There is a single resource pool of DNS servers and the 4492 application should presume that any server will give it the "right" 4493 answer. However, even if all DNS servers are assumed to give equally 4494 useful responses, it is reasonable to expect that some DNS servers will 4495 not accept requests on all interfaces. This patch avoids the problem by 4496 sorting the DNS server addresses using the Windows IPv4/v6 routing tables. 4497 4498 For example, a request to DNS server C on interface 2 that is actually 4499 sent over interface 1 (which may happen to have the default route) may 4500 be rejected by or not delivered to DNS server C. So, better to use DNS 4501 servers A and B associated with interface 1, at least as a first try. 4502 4503 By using the metric of the route to the DNS server itself as a proxy for 4504 priority of the DNS server in the list, this patch is able to adapt 4505 dynamically to changes in the interface list, the DNS server lists per 4506 interface, which interfaces are active, the routing table, and so on, 4507 while always picking a good "best" DNS server first. 4508 4509 In cases where any DNS server on any interface will do, this patch still 4510 seems useful because it will prioritize a lower-metric route's (and thus 4511 interface's) servers. 4512 4513David Drysdale (22 Feb 2017) 4514- [Sergii Pylypenko brought this change] 4515 4516 docs: fixed references to ares_set_local_ip4 and ares_set_local_ip6 4517 4518- [Calle Wilund brought this change] 4519 4520 ares test: fix win32 build errors with virtual socket function tests 4521 4522 The added api requires both some typedefs not previously imported 4523 into the test build + the test code did not fully deal with 4524 socket differences on windows. 4525 4526- [Calle Wilund brought this change] 4527 4528 ares_process: fix return type of socket_create function (win32 warning) 4529 4530Daniel Stenberg (31 Jan 2017) 4531- [Calle Wilund brought this change] 4532 4533 ares_set_socket_functions: Add man page 4534 4535 Providing some rudimentary documentation for the added functionality 4536 4537 Closes #72 4538 4539- [Calle Wilund brought this change] 4540 4541 ares-test: Add test helpers and cases for virtual socket IO 4542 4543 * Added test case macro to automatically run tests twice, once "normal", 4544 once with virtual IO. 4545 * Changed most "live" query tests to run in dual mode to verify 4546 at least simple socket IO via virtual functions 4547 * Added test case for settings/duping socket functions & callback data 4548 4549- [elcallio brought this change] 4550 4551 Implement using virtual socket IO functions when set 4552 4553 Uses virtual socket IO functions when set on a channel. 4554 Note that no socket options are set, nor is any binding 4555 done by the library in this case, since the client defining 4556 these is probably more suited to deal with this. 4557 4558- [elcallio brought this change] 4559 4560 Add virtual function set for socket IO 4561 4562 Defines a structure of basic create, close, read/write 4563 functions as virtual function calls, settable for individual 4564 c-ares channels. 4565 4566David Drysdale (30 Jan 2017) 4567- test: ignore aresfuzzname binary 4568 4569Gregor Jasny (14 Jan 2017) 4570- [Stephen Sorley brought this change] 4571 4572 Always use check_symbol_exists instead of check_function_exists. 4573 4574- Also add includes to TARGETS_INST_DEST 4575 4576- [Stephen Sorley brought this change] 4577 4578 Windows build fixes 4579 4580- CMake: Export targets 4581 4582- CMake: Use GNUInstallDirs for install location defaults 4583 4584David Drysdale (11 Jan 2017) 4585- Update Makefile.am for renamed INSTALL.md 4586 4587GitHub (11 Jan 2017) 4588- [David Drysdale brought this change] 4589 4590 docs: convert INSTALL to MarkDown & tweak (#83) 4591 4592- [Gregor Jasny brought this change] 4593 4594 Merge pull request #77 from stephen-sorley/cmake_modernize 4595 4596 Updated CMake minimum version to 2.8.12. 4597 4598Stephen Sorley (4 Jan 2017) 4599- Changed executables to depend directly on internal libcares target, instead of against 4600 the external-facing alias targets. 4601 4602- Updated Travis to pull CMake 2.8.12 from kubuntu-backports ppa. 4603 4604- Updated CMake minimum version to 2.8.12. 4605 4606 Changed the way usage requirements (include dirs, compile defs, dependent libraries) are specified, to match the recommended standard practice for modern CMake. This involves using target-specific functions (target_include_directories, target_compile_definitions, etc.), along with the PUBLIC, PRIVATE or INTERFACE modifiers. 4607 4608 Updated chain-building support to imitate new-style Find modules (import libs), instead of old-style Find modules (cache variables). 4609 4610David Drysdale (26 Dec 2016) 4611- [Chris Araman brought this change] 4612 4613 configure: clock_gettime workaround (#75) 4614 4615 Commits 7518c26, c41726b, and bc14ee7 brought this workaround to the CMake build system. This expands it to the autoconf build system. 4616 4617 Fixes #71 4618 4619- test: add fuzz entrypoint for ares_create_query() 4620 4621- test: Add gTest/gMock files to SOURCES 4622 4623 Built tarballs are not including all of the files needed 4624 to build the test suite because they are missing from the 4625 <target>_SOURCES variable in Makefile.am. 4626 4627- travis: Move build scripts under travis/ 4628 4629 Travis doesn't always propagate errors in inline multi-line 4630 scripts, so move them all to be explicit shell scripts, each 4631 with set -e. 4632 4633- travis: check distributed tarball builds 4634 4635Daniel Stenberg (25 Oct 2016) 4636- dist: ship msvc_ver.inc too 4637 4638 Reported-by: Bruce Stephens 4639 4640 Fixes #69 4641 4642- [Aaron Bieber brought this change] 4643 4644 fix build on OpenBSD 4645 4646- ares_version.h: bump, working on 1.12.1 now 4647 4648GitHub (18 Oct 2016) 4649- [Gregor Jasny brought this change] 4650 4651 Merge pull request #64 from bradh352/master 4652 4653 Add CMake build system support to C-Ares. 4654 4655Brad House (5 Oct 2016) 4656- suggested PROJECT_NAME change broke chain building as it needs the magic PROJECT_NAME set in the ADD_LIBRARY for matching. Fix to make both goals work 4657 4658- update MacOSX 10.12 detection 4659 4660- Expand XCode clock_gettime fix to include MacOS 10.12, not just iOS10 4661 4662David Drysdale (4 Oct 2016) 4663- Revert "travis: work around bug in PyCParser" 4664 4665 This reverts commit a24a10a348fc00b8cfd684d91894a1df14880ea9. 4666 4667- travis: work around bug in PyCParser 4668 4669 See https://github.com/pyca/cryptography/issues/3187 4670 4671Brad House (3 Oct 2016) 4672- PROJECT_SOURCE_DIR instead of CMAKE_CURRENT_SOURCE_DIR as per @gjasny 4673 4674- use a project name of c-ares as per @gjasny 4675 4676- Import curl conversion of Makefile.inc to cmake form dynamically as per bdoetsch@ameritech.net to make maintaining multiple build systems easier 4677 4678Daniel Stenberg (30 Sep 2016) 4679- dist: add ares_library_initialized.* to the tarball 4680 4681David Drysdale (30 Sep 2016) 4682- test: check ares_create_query with too-long name 4683 4684Daniel Stenberg (30 Sep 2016) 4685- man pages: minor formatting edits 4686 4687Brad House (29 Sep 2016) 4688- merge fc7917e from @daviddrysdale ... travis build updates for cmake 4689 4690- cleanups as per @gjasny ... Use naked IF statements and use NOT DEFINED 4691 4692Version 1.12.0 (29 Sep 2016) 4693 4694Daniel Stenberg (29 Sep 2016) 4695- RELEASE-NOTES: 1.12.0 4696 4697- [David Drysdale brought this change] 4698 4699 ares-test-misc: test ares_create_query with escaped trailing dot 4700 4701- ares_create_query: avoid single-byte buffer overwrite 4702 4703 ... when the name ends with an escaped dot. 4704 4705 CVE-2016-5180 4706 4707 Bug: https://c-ares.haxx.se/adv_20160929.html 4708 4709Brad House (29 Sep 2016) 4710- CMake: Unify library versioning with the libtool methodology to make keeping library versions in sync easier with the autotools build system 4711 4712Daniel Stenberg (29 Sep 2016) 4713- ares_library_initialized.3: added 4714 4715- make: bump CARES_VERSION_INFO for release 4716 4717David Drysdale (29 Sep 2016) 4718- man: update ares_init_options.3 4719 4720Daniel Stenberg (29 Sep 2016) 4721- ares_library_init.3: corrected the ares_library_init_mem proto 4722 4723Brad House (28 Sep 2016) 4724- XCode v8 introduced clock_gettime() for iOS v10. However, it is a weak symbol, which means when earlier iOS versions try to use clock_gettime() it results in a crash due to the missing symbol. Detect this condition and do not set HAVE_CLOCK_GETTIME_MONOTONIC. 4725 4726- Adds cmake build system support to C-Ares. 4727 4728 The patch does not modify any source files, it only adds 3 new files 4729 (CMakelists.txt, ares_build.h.cmake, ares_config.h.cmake) which form the 4730 build system. I've tried to go through as much of the autotools tests and 4731 extracted what I thought was appropriate, though many of the tests aren't 4732 as in-depth in CMake as they are for autotools ... it is unclear why some 4733 of them exist at all, I'm guessing for legacy systems that CMake probably 4734 doesn't support anyhow. 4735 4736 Building the library, and examples (adig, ahost, acountry) plus installation 4737 should work across a large number of tested platforms. The tests have not 4738 yet been integrated. 4739 4740Daniel Stenberg (27 Sep 2016) 4741- README.md: remove space from link 4742 4743- README: link to the correct c-ares badge! 4744 4745 Reported-by: David Hotham 4746 4747 Fixes #63 4748 4749- docs: minor formatting edits 4750 4751- ares_destroy.3: formatting polish 4752 4753- ares_init.3: split the init docs into two separate man pages 4754 4755- SECURITY: point to the vulnerabilities page now 4756 4757- RELEASE-NOTES: synced with daa7235b1a5 4758 4759- ares_create_query.3: edit language 4760 4761 Tried to make the man page more readable. 4762 4763David Drysdale (26 Sep 2016) 4764- test: fix gMock to work with gcc >= 6.x 4765 4766 Taken from: 4767 https://github.com/google/googletest/issues/705#issuecomment-235067917 4768 4769Daniel Stenberg (26 Sep 2016) 4770- [Brad House brought this change] 4771 4772 headers: remove checks for and defines of variable sizes 4773 4774 ... they're not really used and by avoiding them in the ares_build.h 4775 output we make the public header less dependent on data sizes. 4776 4777David Drysdale (24 Sep 2016) 4778- api: add ARES_OPT_NOROTATE optmask value 4779 4780 Fix up a couple of problems with configuring whether c-ares rotates 4781 between different name servers between requests. 4782 4783 Firstly, ares_save_options() returns (in *optmask) the value of 4784 (channel->optmask & ARES_OPT_ROTATE), which doesn't necessarily 4785 indicate whether the channel is or is not actually doing rotation. 4786 This can be confusing/incorrect if: 4787 - the channel was originally configured without ARES_OPT_ROTATE 4788 (so it appears that the channel is not rotating) 4789 - the /etc/resolv.conf file includes the 'rotate' option 4790 (so the channel is actually performing rotation). 4791 4792 Secondly, it is not possible to reliably configure a channel 4793 to not-rotate; leaving off ARES_OPT_ROTATE is not enough, since 4794 a 'rotate' option in /etc/resolv.conf will turn it on again. 4795 4796 Therefore: 4797 - add an ARES_OPT_NOROTATE optmask value to allow explicit 4798 configuration of no-rotate behaviour 4799 - in ares_save_options(), report the value of channel->rotate 4800 as exactly one of (optmask & ARES_OPT_ROTATE) or 4801 (optmask & ARES_OPT_NOROTATE). 4802 4803 In terms of back-compatibility: 4804 - existing apps that set ARES_OPT_ROTATE will continue to rotate, 4805 and to have ARES_OPT_ROTATE reported back from ares_save_options() 4806 - existing apps that don't set ARES_OPT_ROTATE will continue to 4807 use local config/defaults to decide whether to rotate, and will 4808 now get ARES_OPT_ROTATE or ARES_OPT_NOROTATE reported back from 4809 ares_save_options() rather than 0. 4810 4811- ares_init_options: only propagate init failures from options 4812 4813 Commit 46bb820be3a8 ("ares_init_options: don't lose init failure") 4814 changed init behaviour so that earlier errors in initialization 4815 weren't lost. In particular, if the user passes in specific 4816 options but they are not applied (e.g. because of an allocation 4817 failure), that failure needs to be reported back to the user; this 4818 also applies when duplicating a channel with ares_dup(). 4819 4820 However, other initialization failures can be ignored and 4821 overridden -- in particular, if init_by_resolv_conf() or 4822 init_by_environment() fail, then falling back to default values 4823 is OK. 4824 4825 So only preserve failures from the init_by_options() stage, not 4826 from all initialization stages. 4827 4828 Fixes issue 60. 4829 4830- test: Force reinstall of libtool on OSX 4831 4832 Travis build environment appears to have changed. 4833 4834- test: Add valgrind build variant 4835 4836- test: Add null pointer to gtest args 4837 4838 GoogleTest assumes that there is a null pointer in argv[argc], 4839 so make it look like that. Without this change, tests run with 4840 command-line arguments get memory errors under valgrind/ASAN. 4841 4842Daniel Stenberg (21 Aug 2016) 4843- AUTHOR: maybe gitgub isn't really an author =) 4844 4845- AUTHORS: added contributors from the git log 4846 4847- LICENSE.md: add a stand-alone license file 4848 4849 Just the MIT license used in the top the source files moved out to a 4850 stand-alone file for easier reference and discovery. 4851 4852- README: added "CII best practices" badge 4853 4854- SECURITY.md: suggested "security process" for the project 4855 4856David Drysdale (17 Aug 2016) 4857- test: Add Clang static analysis build to Travis 4858 4859 Run scan-build over the library source code, but skip the 4860 tests. Needs a later Clang install in Travis 4861 4862- test: more info on how to run fuzz testing 4863 4864- test: make fuzzer driver code C not C++ 4865 4866- test: fuzzer mode for AFL's persistent mode 4867 4868 When fuzzing with AFL, if the LLVM-based instrumentation is 4869 used (via the afl-clang-fast wrapper), then it is possible to 4870 have a single execution of the fuzzer program iterate multiple 4871 times over the fuzzing entrypoint (similar to libFuzzer's normal 4872 mode of execution) with different data. This is much (e.g. 10x) 4873 faster. 4874 4875 Add code to support this, by checking whether __AFL_LOOP is 4876 defined at compile-time. 4877 4878 Also, shift the code to effectively be C rather than C++. 4879 4880- test: simplify deps for fuzzer entrypoint 4881 4882 No need to depend on the rest of the test code (ares-test.h) for 4883 the fuzzer entrypoint; this makes the entrypoint slightly simpler 4884 to build with LLVM's libFuzzer. 4885 4886 Also shift the code to effectively be C rather than C++ 4887 4888- test: disable MinGW tests 4889 4890 The test binary built in the MinGW build is failing for some 4891 reason. It works for me when I build locally, so I'm guessing 4892 it's down to some sort of AppVeyor environment issue. 4893 4894 Disable for now. 4895 4896Daniel Stenberg (16 Aug 2016) 4897- read_tcp_data: remove superfluous NULL check 4898 4899 CID 56884 by Coverity. The pointer is already derefenced before this 4900 point so it can't be NULL here anyway. 4901 4902- web: http => https 4903 4904GitHub (20 Jul 2016) 4905- [David Drysdale brought this change] 4906 4907 Merge pull request #59 from fuze/master 4908 4909 Update msvc_ver.inc for VS2015 Update 3 4910 4911- [Chris Araman brought this change] 4912 4913 Update msvc_ver.inc 4914 4915 support Visual Studio 2015 Update 3 4916 4917David Drysdale (2 May 2016) 4918- Fix trailing comment for #endif 4919 4920Daniel Stenberg (30 Apr 2016) 4921- email: use Gisle's "new" address 4922 4923David Drysdale (18 Apr 2016) 4924- test: drop superfluous fuzz inputs 4925 4926 Where there are multiple fuzz input files that only differ in 4927 the first two bytes (the query ID), just keep the first such 4928 file. 4929 4930svante karlsson (15 Apr 2016) 4931- Update msvc_ver.inc 4932 4933 support Visual Studio 2015 Update 2 4934 4935David Drysdale (31 Mar 2016) 4936- test: Run fuzzcheck.sh in Travis build 4937 4938- test: add fuzzing check script to tests 4939 4940 Add a test script that runs the fuzzing command over the 4941 corpus of DNS packets. This doesn't actually do any fuzzing 4942 (it just runs them as inputs without generating any variations) 4943 but it does ensure that the fuzzing entrypoint is still working. 4944 4945- test: allow multiple files in aresfuzz command line 4946 4947 If no arguments are specified, use stdin as input. 4948 Otherwise treat each argument as a filename and feed 4949 its contents to the fuzz entrypoint. 4950 4951- test: Add corpus of DNS packets 4952 4953 For fuzz testing it is useful to start from a corpus of valid 4954 packets, so fill out the test/fuzzinput/ directory with a bunch 4955 of inputs. 4956 4957 These packets were generated by temporarily modifying the c-ares 4958 process_answer() function to save off any incoming response messages. 4959 4960- test: Add utility to show DNS packet from file 4961 4962- [nordsturm brought this change] 4963 4964 Fix nsort initialization 4965 4966 Author: Alexander Drachevskiy 4967 http://c-ares.haxx.se/mail/c-ares-archive-2014-07/0004.shtml 4968 http://c-ares.haxx.se/mail/c-ares-archive-2014-07/0014.shtml 4969 4970- test: Check setting nsort=0 option is respected 4971 4972- test: Update fuzzing function prototype 4973 4974 libFuzzer changed expected return type from void to int 4975 in LLVM 3.8. 4976 4977- Explicitly clear struct servent before use 4978 4979 On a build where MSAN has been manually set up (which involves 4980 using an MSAN-instrumented version of the standard C++ library, see 4981 https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo) 4982 there's a warning about use of uninitialized memory here. It 4983 might be a false positive, but the fix is trivial so include it. 4984 4985- test: for AF_UNSPEC, return CNAME only for AAAA, but valid A record 4986 4987 Also shuffle expected responses rsp6/rsp4 into the order they will occur. 4988 4989- [Chris Araman brought this change] 4990 4991 msvc_ver.inc: support Visual Studio 2015 Update 1 4992 4993- build: commonize MSVC version detection 4994 4995 Remove the need to copy/paste version number mapping between 4996 Makefile.msvc and test/Makefile.msvc. 4997 4998- test: Use different name in live test 4999 5000- test: Only pass unused args to GoogleTest 5001 5002- ahost.c: add cast to fix C++ compile 5003 5004 If ahost.c is force-compiled as C++ the missing cast from 5005 (void *) to (char **) is problematic. 5006 5007- ares_library_cleanup: reset ares_realloc too 5008 5009 Otherwise a subsequent use of the library might use a previous 5010 incarnation's realloc() implementation. 5011 5012Daniel Stenberg (9 Mar 2016) 5013- [Brad House brought this change] 5014 5015 configure: check if tests can get built before enabled 5016 5017 The current approach for disabling tests is not a good solution because 5018 it forces you to pass --disable-tests, rather than auto-detect if your 5019 system can support the tests in the first place. Many (most?) systems 5020 do not have C++11. This also causes issues when chain-building c-ares, 5021 the hosting system needs to be updated to support passing this 5022 additional flag if necessary, it doesn't seem reasonable to add this 5023 requirement which breaks compatibility. 5024 5025 This change auto-detects if the system can build the tests and 5026 automatically disable them if it cannot. If you pass --enable-tests to 5027 configure and the system cannot build them either due to lack of system 5028 support, or because cross-compilation is being used, it will throw an 5029 appropriate error since the user indicated they really did want the 5030 tests. 5031 5032David Drysdale (3 Mar 2016) 5033- [Viktor Szakats brought this change] 5034 5035 Makefile.m32: add support for CROSSPREFIX 5036 5037- [Viktor Szakats brought this change] 5038 5039 Makefile.m32: add support for extra flags 5040 5041 Allow specification of CARES_{LD,C}FLAG_EXTRAS envvars 5042 for mingw 5043 5044- test: Build with MinGW on AppVeyor 5045 5046- test: avoid in6addr_* constants 5047 5048 These aren't available on MinGW, so use explicit addresses instead. 5049 5050- test: add missing #includes for dns-proto.cc 5051 5052- [Gregor Jasny brought this change] 5053 5054 Fix man page typos detected by Lintian 5055 5056Daniel Stenberg (19 Feb 2016) 5057- configure: acknowledge --disable-tests 5058 5059 Fixes #44 5060 5061- AUTHORS: added contributors from the 1.11.0 release 5062 5063- bump: start working on the next version 5064 5065Version 1.11.0 (19 Feb 2016) 5066 5067Daniel Stenberg (19 Feb 2016) 5068- RELEASE-NOTES: final edits for 1.11.0 5069 5070David Drysdale (15 Feb 2016) 5071- ares_dup.3: remove mention of nonexistent function 5072 5073 ares_dup_options() doesn't exist, so don't document it. 5074 5075- test: skip repeated build steps 5076 5077 Top-level buildconf/configure now triggers for the 5078 test/ subdir too, so don't need to do explicitly. 5079 5080- test: namespaces unavailable when cross-compiling 5081 5082Daniel Stenberg (13 Feb 2016) 5083- configure: only run configure in test when NOT cross-compiling 5084 5085 ... as the tests won't run cross-compiled anyway 5086 5087David Drysdale (13 Feb 2016) 5088- test: prefer ON_CALL to EXPECT_CALL to reduce flakes 5089 5090 For UDP tests, there's a chance of a retry. EXPECT_CALL only 5091 expects a single request to arrive at the server; ON_CALL allows 5092 for a UDP retry and repeats the same answer. 5093 5094 Note that ON_CALL and EXPECT_CALL can't be mixed in the same 5095 test, and that tests that have a varied sequence of responses 5096 for the same repeated request still have to use EXPECT_CALL. 5097 5098Daniel Stenberg (13 Feb 2016) 5099- configure: run configure in 'test' too 5100 5101 Having the test dir completely stand-alone causes too many issues for 5102 users and devs. It still needs to be built specifically. 5103 5104- configure: build silently by default 5105 5106- buildconf: run test/buildconf too if present 5107 5108- test/configure: build silently by default 5109 5110- [Gregor Jasny brought this change] 5111 5112 dist: Distribute README.md 5113 5114 Closes #42 5115 5116Version 1.11.0 (11 Feb 2016) 5117 5118Daniel Stenberg (11 Feb 2016) 5119- Makefile.am: distribute the test dir too 5120 5121- RELEASE-NOTES: synced with 385582bd14b68a 5122 5123- [Nicolas \"Pixel\" Noble brought this change] 5124 5125 ares_win32_init: make LoadLibrary work when using UNICODE too 5126 5127 Closes #17 5128 5129David Drysdale (11 Feb 2016) 5130- Use "resolve" as synonym of "dns" in nsswitch.conf 5131 5132 Modern Linux systems may have libnss_resolve from systemd as the 5133 resolver, which is then configured in /etc/nsswitch.conf with 5134 the "resolve" keyword rather than "dns". 5135 5136 Fixes #33 5137 5138- ares_set_socket_callback: make manpage match code 5139 5140 The code in ares_process.c that invokes the socket creation/connection 5141 callback only checks for rc < 0, not for standard ares error codes. 5142 5143- Merge pull request #36 from AGWA-forks/master 5144 5145 Add ares_set_socket_configure_callback() 5146 5147- test: Update init tests to match behaviour 5148 5149 Unreadable config files are now treated the same way 5150 as absent config files. 5151 5152- [Fedor Indutny brought this change] 5153 5154 Ignore `fopen` errors to use default values 5155 5156 After 46bb820be3a83520e70e6c5f0c5133253fcd69cd `init_by_resolv_conf` 5157 errors are no longer swallowed in `ares_init_options`. This has exposed 5158 a previously unknown bug in `lookups` initialization code. 5159 5160 If there is no lookup configuration in `resolv.conf`, 5161 `init_by_resolv_conf` will attempt to read it from other files available 5162 on the system. However, some of these files may have restricted 5163 permissions (like `600`), which will lead to `EACCESS` errno, which in 5164 turn is handled like a fatal error by `init_by_resolv_conf`. 5165 5166 However, it sounds illogical that this error should be handled as a 5167 fatal. There is a `init_by_defaults` call that overrides `lookups` with 5168 default value, and certainly possible absence of lookup information is 5169 the reason why this function exists in a first place! 5170 5171 I suggest handling any `fopen` errors as non-fatal ones, allowing to 5172 pick up the `lookups` value from different config files, or to pick up 5173 default value. 5174 5175Andrew Ayer (9 Feb 2016) 5176- Document callback type in man page for ares_set_socket_callback 5177 5178- Add ares_set_socket_configure_callback() 5179 5180 This function sets a callback that is invoked after the socket is 5181 created, but before the connection is established. This is an ideal 5182 time to customize various socket options. 5183 5184David Drysdale (9 Feb 2016) 5185- test: ares_set_socket_callback failure behaviour 5186 5187- test: Check ares_parse_txt_reply_ext() entrypoint 5188 5189- [Fedor Indutny brought this change] 5190 5191 txt: introduce `ares_parse_txt_reply_ext` 5192 5193 Introduce `ares_txt_ext` structure with an extra `record_start` 5194 field, which indicates a start of a new TXT record, thus allowing to 5195 differentiate the chunks in the same record, from a chunks in a 5196 different record. 5197 5198 Introduce a new API method: `ares_parse_txt_reply_ext` that works with 5199 this kind of struct. 5200 5201- doc: Update missed repo references 5202 5203- doc: Update docs on contributing 5204 5205- test: Run command line tools in Travis 5206 5207 Do a quick execution of each of the command line tools 5208 in the continuous integration build, so that any (say) 5209 sanitizer failures show up. 5210 5211- acountry: drop inert test 5212 5213 If ver_1 is true, then z0 and z1 must both be 'z', and so 5214 (z0 != 'z' && z1 != 'z') can never be true. 5215 5216 CID 56879, pointed out by Coverity. 5217 5218- doc: update badge locations to master repo 5219 5220- test: Enable maintainer mode + debug in Travis 5221 5222- test: Add an iOS build target 5223 5224- test: Ignore SIGPIPE in tests 5225 5226- test: More initialization tests 5227 5228- test: Improve containerized test mechanism 5229 5230 Aim is to ensure that code coverage information can escape the 5231 container. To do this: 5232 - Enter a new mount namespace too, so that we can... 5233 - Bind mount the expected source directory into the container 5234 - Share memory with the sub-process so coverage information is 5235 shared too. 5236 5237- test: Make contained tests easier to write 5238 5239- test: Add framework for containerized testing 5240 5241 On Linux we can potentially use user and UTS namespaces to run a test 5242 in a pseudo-container with: 5243 - arbitrary filesystem (e.g. /etc/resolv.conf, /etc/nsswitch.conf, /etc/hosts) 5244 - arbitrary hostname/domainname. 5245 5246 Include a first pass at the framework code to allow this, along with a 5247 first test case that uses the container. 5248 5249- test: Use a longer timeout for less flakiness 5250 5251 Having occasional test failures from timeout before multiple 5252 queries can complete, so up the default timeout for the test 5253 from 100ms to 1500ms. 5254 5255- test: Make failure tests more robust 5256 5257 Different platforms will do different numbers of allocations 5258 in the processing of a given API call; just check that the 5259 return code is either success or ENOMEM, and free off any 5260 returned state in the former case. 5261 5262 Also cope with ECONNREFUSED as well as ENOTFOUND. 5263 5264- test: Get test code building under Windows 5265 5266 - Initial nmake file based off library nmake file 5267 - Cast socket call arguments to (char *) 5268 - Use wrapper sclose() that maps to closesocket() or close() 5269 - Build a config.h indicating presence of headers 5270 - Conditionally include netdb.h 5271 - Remove unnecessary include of sys/socket.h 5272 - Force longer bitmask for allocation failure tracking 5273 - Call WSAStartup() / WSACleanup() in main() 5274 - Set TCP_NODELAY for mock server 5275 - Turn on tests in AppVeyor build 5276 5277- test: Disable tests that manipulate env on Windows 5278 5279- test: Move file lists into Makefile.inc 5280 5281 In preparation for a Win32 build of the test suite. 5282 5283- test: Add a simple multi-server test 5284 5285 Check rotate option does something 5286 5287- test: Allow for multiple mock servers 5288 5289 - Update the MockServer to allow separate specification of 5290 UDP and TCP ports 5291 - Have an array of mock servers listening on consecutive 5292 sets of ports. 5293 - Rename Process(fd) to ProcessFD(fd) to avoid confusion. 5294 - Initialize channel by using the new ares_set_servers_ports() 5295 entrypoint, so multiple ports on the same loopback address 5296 can be used. 5297 5298- test: Update test for set/get_servers variants 5299 5300 Ports are significant in the _ports_ variant functions, so update test to cope. 5301 5302- test: Make GetNameServers() utility function port-aware 5303 5304 Also make it generally available. 5305 5306- test: more testing, including of internal static functions 5307 5308- test: more tests, especially fallback processing 5309 5310 - Make mock server listen on UDP + TCP in parallel. 5311 - Test UDP->TCP fallback on truncation 5312 - Test EDNS->no-EDNS fallback 5313 - Test some environment init options 5314 - Test nonsense reply 5315 5316 test: short response 5317 5318- test: more tests, particularly of initialization 5319 5320- test: Run mock tests over both TCP and UDP 5321 5322 With the exception of a few tests that make use of the timed 5323 retry aspect of UDP. 5324 5325- test: Run mock tests over both IPv4 and IPv6 5326 5327- test: Add more tests for edge cases 5328 5329- test: more nooks and crannies of pton functions 5330 5331- test: More tests for PTR parsing 5332 5333- test: Use of HOSTALIAS environment variable 5334 5335- test: Add RAII utility classes for testing 5336 5337 - TempFile holds specific contents 5338 - EnvValue sets an environment variable 5339 5340- test: More search domain scenarios 5341 5342- test: Remove duplicate flags from Makefile.am 5343 5344- test: Make test code leak-free 5345 5346- test: More tests 5347 5348 - test use of sortlist 5349 - test gethostbyname(AF_UNSPEC) 5350 5351- test: Test ares_gethostbyname_file() 5352 5353- test: Add more tests of ares_getnameinfo() 5354 5355- test: Tweak tests, add alloc failure test 5356 5357- test: Test init with options 5358 5359- test: More tests 5360 5361 - ares_inet_net_pton() variants 5362 - ares_getsock() variants 5363 5364- test: Expose ProcessWork() function 5365 5366- test: More parsing tests 5367 5368 Including: 5369 - Split each parse function test set out into separate files. 5370 - Add an allocation failure test for each parsing function. 5371 - Add error check test for each parsing function. 5372 5373- test: Add various additional tests 5374 5375- test: More tests 5376 5377 Include tests of internal functions, based on the value of the 5378 CARES_SYMBOL_HIDING macro; need to configure the library with 5379 --disable-symbol-hiding to enable these tests. 5380 5381- test: Allow command line override of mock server port 5382 5383- test: Add README.md documentation 5384 5385- test: Temporarily avoid latest Python requests package 5386 5387 Currently get error from Travis on this install step, and downgrading one 5388 version appears to fix the problem. 5389 5390 "Could not find any downloads that satisfy the requirement pyOpenSSL>=0.13 5391 (from requests[security])" 5392 5393- test: Add AppVeyor config file for Windows build 5394 5395- test: Add configuration for a Travis build 5396 5397 Cover Linux & OSX on the container infrastructure, but install 5398 a later G++ to satisfy the tests' need for C++11. 5399 5400 Use a build matrix to include a variety of build variants: 5401 - ASAN 5402 - UBSAN 5403 - LSAN 5404 - Coverage via coveralls.io 5405 5406 test: invoke ASAN and coverage in Travis build 5407 5408 Also shift to use explicit build matrix 5409 5410 test: Use coveralls.io for coverage tracking 5411 5412 test: Add a build with UBSAN 5413 5414 Also expand and re-order the setting of environment variables 5415 for easier modification. 5416 5417 test: Add LSAN build to Travis config 5418 5419- test: Add initial unit tests for c-ares library 5420 5421 The tests are written in C++11, using the GoogleTest and GoogleMock 5422 frameworks. They have their own independent autoconf setup, so that 5423 users of the library need not have a C++ compiler just to get c-ares 5424 working (however, the test/configure.ac file does assume the use of 5425 a shared top-level m4/ directory). However, this autoconf setup has 5426 only been tested on Linux and OSX so far. 5427 5428 Run with "./arestest", or "./arestest -v" to see extra debug info. 5429 The GoogleTest options for running specific tests are also 5430 available (e.g. "./arestest --gtest_filter=*Live*"). 5431 5432 The tests are nowhere near complete yet (currently hitting around 5433 60% coverage as reported by gcov), but they do include examples 5434 of a few different styles of testing: 5435 5436 - There are live tests (ares-test-live.cc), which assume that the 5437 current machine has a valid DNS setup and connection to the 5438 internet; these tests issue queries for real domains but don't 5439 particularly check what gets returned. The tests will fail on 5440 an offline machine. 5441 5442 - There a few mock tests (ares-test-mock.cc) that set up a fake DNS 5443 server and inject its port into the c-ares library configuration. 5444 These tests allow specific response messages to be crafted and 5445 injected, and so are likely to be used for many more tests in 5446 future. 5447 5448 - To make this generation/injection easier, the dns-proto.h file 5449 includes C++ helper classes for building DNS packets. 5450 5451 - Other library entrypoints that don't require network activity 5452 (e.g. ares_parse_*_reply) are tested directly. 5453 5454 - There are few tests of library-internal functions that are not 5455 normally visible to API users (in ares-test-internal.cc). 5456 5457 - A couple of the tests use a helper method of the test fixture to 5458 inject memory allocation failures, using the earlier change to the 5459 library to allow override of malloc/realloc/free. 5460 5461 - There is also an entrypoint to allow Clang's libfuzzer to drive 5462 the packet parsing code in ares_parse_*_reply, together with a 5463 standalone wrapper for it (./aresfuzz) to allow use of afl-fuzz 5464 for further fuzz testing. 5465 5466- test: Add local copy of GoogleMock/GoogleTest 1.7.0 5467 5468 Don't check in gtest/m4 files, as they are unused and interfere 5469 with the top-level configure process. 5470 5471- doc: Show build badges in README.md 5472 5473 Note that these URLs will need to be updated if/when the test branch 5474 gets pulled into the master repo/branch. 5475 5476- doc: Convert README to README.md 5477 5478 Gives better display on GitHub 5479 5480- doc: Update in preparation for next release 5481 5482 Assume 1.11.0 is next (as there are various API additions). 5483 Also add myself to AUTHORS. 5484 5485- build: Allow header compilation by Windows C++ compiler 5486 5487- build: Expose whether symbol hiding is on 5488 5489 Adding the CARES_SYMBOL_HIDING definition allows the test suite to 5490 detect whether internal symbols are available or not. 5491 5492- build: Add autoconf macros for C++11 code using pthreads 5493 5494 Pull in testing macros from the GNU autoconf archive to allow 5495 configure scripts to test for and setup use of a C++11 compiler 5496 (AX_CXX_COMPILE_STDCXX_11) and the pthreads library (AX_PTHREAD). 5497 5498 Note that these macros are not used by the main library autoconf, 5499 just by the tests (which share the same m4/ directory). 5500 5501- build: Add a code coverage option 5502 5503 Configure with: 5504 ./configure --enable-code-coverage 5505 Show coverage output with: 5506 make code-coverage-capture 5507 5508 Built on m4/ax_code_coverage.m4 from the GNU autoconf archive 5509 to provide the macros to check for presence of gcov + lcov; 5510 upstream macro modified to: 5511 - Remove use of $(AM_DEFAULT_VERBOSITY) , as earlier versions of 5512 autoconf (such as the one used by default on Travis) do not have this. 5513 - Rather than automatically defining CODE_COVERAGE_RULES to be a set 5514 of makefile rules that use ifeq/endif (which is GNU make-specific), 5515 instead only define CODE_COVERAGE_RULES if coverages is turned on, 5516 and in that case don't use conditionals in the makefile. 5517 5518- api: Add entrypoints to allow use of per-server ports 5519 5520 Add user-visible entrypoints ares_{get,set}_servers_ports(3), which 5521 take struct ares_addr_port_node rather than struct ares_addr_node. 5522 This structure includes a UDP and TCP port number; if this is set 5523 to zero, the channel-wide port values are used as before. 5524 5525 Similarly, add a new ares_set_servers_ports_csv(3) entrypoint, which 5526 is analogous to ares_set_servers(3) except it doesn't ignore any 5527 specified port information; instead, any per-server specified port 5528 is used as both the UDP and TCP port for that server. 5529 5530 The internal struct ares_addr is extended to hold the UDP/TCP ports, 5531 stored in network order, with the convention that a value of zero 5532 indicates that the channel-wide UDP/TCP port should be used. 5533 5534 For the internal implementation of ares_dup(3), shift to use the 5535 _ports() version of the get/set functions, so port information is 5536 transferred correctly to the new channel. 5537 5538 Update manpages, and add missing ares_set_servers_csv to the lists 5539 while we're at it 5540 5541- api: Add ares_set_sortlist(3) entrypoint 5542 5543 Allow explicit configuration of the channel's sortlist, by 5544 specifying a string in the same format as the equivalent 5545 /etc/resolv.conf option. 5546 5547 This allows library users to perform the same configuration 5548 that is available via /etc/resolv.conf, but without needing 5549 to change that file. 5550 5551- api: Allow injection of user-specified malloc/free functions 5552 5553 Add a new ares_library_init_mem() initialization function for the 5554 library which allows the library user to specify their own malloc, 5555 realloc & free equivalents for use library-wide. 5556 5557 Store these function pointers in library-wide global variables, 5558 defaulting to libc's malloc(), realloc() and free(). 5559 5560 Change all calls to malloc, realloc and free to use the function pointer 5561 instead. Also ensure that ares_strdup() is always available 5562 (even if the local environment includes strdup(3)), and change the 5563 library code to always use it. 5564 5565 Convert calls to calloc() to use ares_malloc() + memset 5566 5567- api: Add option to expose some internal functions 5568 5569 Purely for testing, add --enable-expose-statics option to configure 5570 which converts some static internal functions to be externally visible. 5571 5572- api: Expose the ares_library_initialized() function 5573 5574- ahost: Allow repeated -s <domain> options 5575 5576 This also removes a potential leak where later -s options would 5577 replace earlier ones without freeing the relevant string. 5578 5579- Mark unhittable lines 5580 5581 Add comments for the benefit of the lcov tool, marking 5582 lines that cannot be hit. Typically these are fall-back 5583 protection arms that are already covered by earlier checks, 5584 and so it's not worth taking out the unhittable code (in case 5585 someone changes the code between the two places in future). 5586 5587- ares_set_servers_csv.3: make return type match code 5588 5589- bitncmp: update comment to match code behaviour 5590 5591- ares_striendstr: fix so non-NULL return can happen 5592 5593 This looks to have been broken since it was first introduced in 2005 in 5594 commit aba0b775ea30 ("Added ares_getnameinfo which mimics the 5595 getnameinfo API") 5596 5597- config_sortlist: free any existing sortlist on (re)alloc failure 5598 5599 If we get an allocation failure on 2nd or later entry in the sortlist, the 5600 code would return ENOMEM but still leave the initial entries allocated. 5601 Ensure that *sortlist is set to NULL whenever ENOMEM is returned. 5602 5603- ares_dup: clear new channel on failure 5604 5605 If the attempt to transfer IPv6 servers from the old to the new channel 5606 fails, the previous code would still return a channel to the user even though 5607 an error return code was generated. This makes it likely that users would 5608 leak the channel, so explicitly clear the channel in this case. 5609 5610- ares_init_options: don't lose init failure 5611 5612 If (say) init_by_options() fails, the subsequent call to 5613 init_by_defaults() was overwriting the return code with 5614 success. Still call init_by_defaults() regardless, but track 5615 its return value separately 5616 5617- ares_gethostbyname: don't leak valid-but-empty hostent 5618 5619 If an AF_UNSPEC query gets a valid response to its AAAA query, 5620 but which has no IPv6 addresses in it, then the code chains on to 5621 a A record query. However, the hostent from the AAAA response 5622 was being leaked along the way (because it gets replaced before 5623 the follow-on end_hquery() invocation). 5624 5625- ares_parse_txt_reply: propagate errors from per-substring loop 5626 5627 If we get an allocation failure when processing a particular substring in a 5628 TXT record, that failure is silently lost; fix that by propagating errors from 5629 the inner loop to the outer loop. 5630 5631- process_answer: fix things up correctly when removing EDNS option 5632 5633 When a server rejects an EDNS-equipped request, we retry without 5634 the EDNS option. However, in TCP mode, the 2-byte length prefix was 5635 being calculated wrong -- it was built from the answer length rather than 5636 the length of the original request. 5637 5638 Also, it is theoretically possible that the call to realloc() might change 5639 the data pointed to; to allow for this, qbuf also needs updating. 5640 5641 (Both these fixes were actually included in a patchset sent on the mailing 5642 list in Oct 2012, but were included with other functional changes that 5643 didn't get merged: 5644 http://c-ares.haxx.se/mail/c-ares-archive-2012-10/0004.shtml) 5645 5646- ares__read_line: clear buf pointer on realloc failure 5647 5648- ares_expand_name: check for valid bits in label length 5649 5650 The top two bits of the label length indicate whether this is a 5651 label length (00) or an index to a name elsewhere in the message 5652 (11). RFC1035 4.1.4 says that the other possible values for the 5653 top two bits (01, 10) are reserved for future use. 5654 5655Daniel Stenberg (23 Jan 2016) 5656- [Gregor Jasny brought this change] 5657 5658 Fix typos detected by lintian 5659 5660 Closes #32 5661 5662- [Gregor Jasny brought this change] 5663 5664 Distribute all man pages 5665 5666- README.cares: s/I/Daniel 5667 5668 ... and add a pointer to an existing version of the original area 1.1.1 5669 package.a 5670 5671- read_tcp_data: don't try to use NULL pointer after malloc failure 5672 5673 CID 56884, pointed out by Coverity. We really should make this function 5674 return an error code so that a malloc() failure can return back a major 5675 failure. 5676 5677- configure_socket: explicitly ignore return code 5678 5679 CID 56889 in Coverity pointed out the return code from setsocknonblock() 5680 is ignored, and this added typecast to (void) makes it explicit. 5681 5682- ahost: check the select() return code 5683 5684 Fixes CID 137189, pointed out by Coverity 5685 5686David Drysdale (18 Jan 2016) 5687- Fix buildconf on platforms using glibtoolize 5688 5689 Commit c49a87eea538 changed buildconf to only check for 5690 libtoolize, but missed a line 5691 5692- Don't exit loop early leaving uninitialized entries 5693 5694 Update for commit affc63cba875d. 5695 5696 The original patch from Gregor Jasny did not have the break 5697 statement; I incorrectly added it to prevent continuing the loop. 5698 However, the later entries in the array would then be left 5699 uninitialized, causing problems for later cleanup. 5700 5701 So fix to match Gregor's original patch, with apologies. 5702 5703Daniel Stenberg (18 Jan 2016) 5704- buildconf: remove check for libtool, it only requires libtoolize 5705 5706David Drysdale (17 Jan 2016) 5707- [Gregor Jasny brought this change] 5708 5709 Use libresolv to initialize cares on iPhone targets 5710 5711 On iPhone targets like iOS, watchOS or tvOS the file 5712 /etc/resolv.conf cannot be used to configure cares. 5713 5714 Instead the resolver library is queried for configuration 5715 values. 5716 5717 CC: Yury Kirpichev <ykirpichev@yandex-team.ru> 5718 5719Daniel Stenberg (17 Jan 2016) 5720- README: updated to new repo URL 5721 5722David Drysdale (14 Jan 2016) 5723- [Lei Shi brought this change] 5724 5725 Fixing slow DNS lookup issue 5726 5727 This patch is fixing the dns lookup issue due to dummy dns information 5728 of a disconnected adapter(in my case is a bluetooth adapter). I changed 5729 the dns lookup policy to try GetNetworkParams first because the 5730 GetNetworkParams provides the most reliable dns information (lots of 5731 checks were done by system). I also filter out inoperable adapter in 5732 DNS_AdaptersAddresses in case GetNetworkParams fail. 5733 5734- Merge pull request #30 from p-push/vs-2015 5735 5736 Support Visual Studio 2015 5737 5738Oleg Pudeyev (3 Jan 2016) 5739- [Gisle Vanem brought this change] 5740 5741 Support Visual Studio 2015 5742 5743David Drysdale (11 Nov 2015) 5744- [Andrew Andkjar brought this change] 5745 5746 added another version case to Makefile.msvc 5747 5748 nmake version 11.00.61030.0 resolves to CC_VERS_NUM = 110 5749 5750- Merge pull request #26 from bitbouncer/vs-2013 5751 5752 added define for visual studio 2013 5753 5754svante karlsson (25 Jun 2015) 5755- added define for visual studio 2013 5756 5757Jakub Hrozek (6 Nov 2014) 5758- ares__read_line: free buf on realloc failure 5759 5760- Destroy options if ares_save_options fails 5761 5762 It's possible that, if ares_save_options failed, the opts structure 5763 would contain some allocated memory. Calling ares_destroy_options in 5764 this case is safe, because ares_save_options zeroes out the memory 5765 initially. 5766 5767- [David Drysdale brought this change] 5768 5769 Continue loop if space for hostname not large enough 5770 5771 When attempting to build a search domain from the local hostname 5772 (used as a fallback when no other methods have given a search 5773 domain), the code doubles the buffer size on each loop iteration. 5774 5775 However, the loop previously had a WHILE_FALSE terminator so the continue 5776 statement exited the loop rather than going round again. 5777 5778Daniel Stenberg (30 Oct 2014) 5779- ares_getnameinfo.3: there is no ares_getaddrinfo 5780 5781David Drysdale (30 Sep 2014) 5782- [Gregor Jasny brought this change] 5783 5784 Prevent tmpbuf from overrunning 5785 5786 Fix Coverity error CID 56886. 5787 5788 Signed-off-by: Gregor Jasny <gjasny@googlemail.com> 5789 5790- [Gregor Jasny brought this change] 5791 5792 Re-start loop if select fails 5793 5794 Fix Coverity error CID 56882 5795 5796 Signed-off-by: Gregor Jasny <gjasny@googlemail.com> 5797 5798- [Gregor Jasny brought this change] 5799 5800 Free temporary variable in error path 5801 5802 Fix Coverity CID 56890 5803 5804 Signed-off-by: Gregor Jasny <gjasny@googlemail.com> 5805 5806- [Gregor Jasny brought this change] 5807 5808 Fix integer shift overflow if both tcp_socket and udp_socket are set 5809 5810 The problem occurs if at the start of the loop the sockindex is at the 5811 last valid ARES_GETSOCK_MAXNUM position. If then both udp_socket and 5812 tcp_socket are valid, sockindex gets incremented for UDP first and 5813 points one entry behind the array for the tcp block. 5814 So the fix is to check after every increment of sockindex if it is still 5815 valid. 5816 5817 Fix Coverity error CID 56878 5818 5819 Signed-off-by: Gregor Jasny <gjasny@googlemail.com> 5820 5821- [Gregor Jasny brought this change] 5822 5823 Null check before dereference 5824 5825 Fix Coverity error CID 56880 5826 5827 Signed-off-by: Gregor Jasny <gjasny@googlemail.com> 5828 5829Jakub Hrozek (28 Jul 2014) 5830- [Gisle Vanem brought this change] 5831 5832 Comment in ares_ipv6.h 5833 5834David Drysdale (25 Jul 2014) 5835- CONTRIBUTING: add file to indicate mailing list is preferred 5836 5837- Add -t u option to ahost 5838 5839 Add an option to allow specification of the AF_UNSPEC 5840 address family. 5841 5842Jakub Hrozek (24 Jul 2014) 5843- host_callback: Fall back to AF_INET on searching with AF_UNSPEC 5844 5845 Previously, when an ares_gethostbyname() searched with AF_UNSPEC and the 5846 first AF_INET6 call only returned CNAMEs, the host_callback never 5847 retried AF_INET. 5848 5849 This patch makes sure than on ARES_SUCCESS, the result of AF_INET6 is 5850 taken as authoritative only if the result contains some addresses. 5851 5852- [David Drysdale brought this change] 5853 5854 Move memset call below platform-specific declarations 5855 5856 A GitHub commenter [1] says that my recent change to ahost.c has 5857 problems compiling on Windows + C89 platforms. 5858 5859 [1] https://github.com/bagder/c-ares/commit/ee22246507c9#commitcomment-6587616 5860 5861- [David Drysdale brought this change] 5862 5863 Update ahost man page to describe -s option. 5864 5865 Commit ee22246507c9 added the -s <domain> option to the 5866 ahost command, but neglected to update the man page to 5867 describe it. 5868 5869 Also fix typo in description of -t option. 5870 5871- ares_parse_soa_reply: Do not leak rr_name on allocation failure 5872 5873 If ares_malloc_data failed, already allocated rr_name would go out of 5874 scope. 5875 5876- [David Drysdale brought this change] 5877 5878 Don't override explicitly specified search domains 5879 5880 Only set search domains from /etc/resolv.conf if there isn't a value 5881 already present in the channel. 5882 5883- [David Drysdale brought this change] 5884 5885 Allow specification of search domain in ahost 5886 5887 Add the "-s domain" command line option to override the search 5888 domains. 5889 5890Daniel Stenberg (12 May 2014) 5891- Revert "ares_parse_aaaa_reply: fix leak when reply contains 1 alias and no address" 5892 5893 This reverts commit 440110b303fdbfadb3ad53d30eeb98cc45d70451. 5894 5895- [Frederic Germain brought this change] 5896 5897 ares_parse_aaaa_reply: fix leak when reply contains 1 alias and no address 5898 5899- [Doug Kwan brought this change] 5900 5901 ares_build.h: fix building on 64-bit powerpc 5902 5903 There are two issues. 5904 5905 1. gcc actually does not use __ppc__ and __ppc64__ but __PPC__ and 5906 __PPC64__. The tests of __ILP32__ and __LP64__ are sufficient for gcc. 5907 5908 2. clang defines __GNU__ and defines both __ppc64__ and __ppc__ when 5909 targeting ppc64. This makes CARES_SIZEOF_LONG to be 4 on a ppc64 system 5910 when building with clang. 5911 5912 My patch is two change the order of the checks so that we check the 5913 64-bit case first. 5914 5915- refresh: updated now with automake 1.14 5916 5917- [David Drysdale brought this change] 5918 5919 single_domain: Invalid memory access for empty string input 5920 5921 We noticed a small buglet in ares_search() when it gets an empty string 5922 as input -- the single_domain() utility function in ares_search.c 5923 accesses invalid memory (before the start of the string). 5924 5925Guenter Knauf (31 Aug 2013) 5926- Fixed warning 'type specifier missing'. 5927 5928Daniel Stenberg (30 Aug 2013) 5929- [Tor Arntsen brought this change] 5930 5931 ares_rules.h: CARES_SIZEOF_LONG doesn't exist anymore, don't test for it 5932 5933 It was removed in f19387dd72432 5934 5935- nowarn: use <limits.h> instead of configure for size of long 5936 5937 This makes the header file much more multi-arch friendly and can be used 5938 as-is with both 32 bit and 64 bit builds. 5939 5940- timeoffset: made static and private 5941 5942 ares__timeoffset() was only used once within this single source file 5943 5944- timeadd: make static 5945 5946 ares__timeadd() was only ever used from within the same source 5947 5948Yang Tse (18 Jul 2013) 5949- xc-am-iface.m4: comments refinement 5950 5951- configure: fix 'subdir-objects' distclean related issue 5952 5953 See XC_AMEND_DISTCLEAN comments for details. 5954 5955- configure: automake 1.14 compatibility tweak (use XC_AUTOMAKE) 5956 5957- xc-am-iface.m4: provide XC_AUTOMAKE macro 5958 5959Daniel Stenberg (12 May 2013) 5960- gitignore: ignore all ares_*pdf but also CHANGES.dist 5961 5962- bump: start working towards 1.10.1 5963 5964Version 1.10.0 (12 May 2013) 5965 5966Daniel Stenberg (12 May 2013) 5967- RELEASE-NOTES: two more bug fixes 5968 5969- [Keith Shaw brought this change] 5970 5971 ares_set_servers_csv: fixed IPv6 address parsing 5972 5973 Fixed bug that caused the last part of an IPv6 address to be parsed as 5974 the port number when the last part is all numeric. 5975 5976- nroff: fix two syntax mistakes 5977 5978 ares_parse_a_reply and ares_parse_aaaa_reply both had two \fB instead of 5979 \fP 5980 5981 Reported-by: Alexander Klauer 5982 Bug: http://c-ares.haxx.se/mail/c-ares-archive-2013-03/0010.shtml 5983 5984- [Alex Loukissas brought this change] 5985 5986 build: fix build on msvc11 5987 5988- Makefile.am: increment -version-info for 1.10.0 release 5989 5990- README: remove unnecessary comment 5991 5992- ares_version.h: copyright end range year is now 2013 5993 5994- RELEASE-NOTES: synced with fb0737f3a0a1c37 5995 5996- [Paul Saab brought this change] 5997 5998 ares_parse_aaaa_reply: Plug memory leak 5999 6000 This change is similar to ares_parse_a_reply.c in commit 6001 bffd67f16a8f42fe6dbf79ab2e39d92eea05c8a6 6002 6003- [Patrick Valsecchi brought this change] 6004 6005 ares_parse_txt_reply: return a ares_txt_reply node for each sub-string 6006 6007 Previously, the function would wrongly return all substrings merged into 6008 one. 6009 6010- [Alexander Klauer brought this change] 6011 6012 library init: documentation update 6013 6014 This commit updates the documentation of ares_library_init() and 6015 ares_library_cleanup() with regard to the newly introduced reference 6016 counting of initializations and deinitializations. 6017 6018- [Alexander Klauer brought this change] 6019 6020 library init: be recursive 6021 6022 Previously, a single call to ares_library_cleanup() would deinitialise 6023 the c-ares library, regardless of how many times ares_library_init() was 6024 called. This behaviour may cause problems in programs linking two or 6025 more libraries which, in turn, use c-ares. The present commit fixes this 6026 problem, deinitializing the library only after a number of calls to 6027 ares_library_cleanup() matching the number of calls to 6028 ares_library_init(). 6029 6030- [Patrick Valsecchi brought this change] 6031 6032 protocol parsing: check input data stricter 6033 6034 ... so that bad length fields aren't blindly accepted 6035 6036 Bug: http://c-ares.haxx.se/mail/c-ares-archive-2013-04/0016.shtml 6037 6038Guenter Knauf (11 Apr 2013) 6039- Create ares_build.h when buidling from Git. 6040 6041- Added -DCARES_STATICLIB to CFLAGS. 6042 6043 Currently this static makefile does only support building the 6044 static library libcares.a. 6045 6046Daniel Stenberg (8 Apr 2013) 6047- [Alexander Klauer brought this change] 6048 6049 .gitignore: ignore patch files 6050 6051 This commit adds a line to .gitignore to the effect that patch files 6052 generated by 'git format-patch' are excluded from the repository. 6053 6054- [Alexander Klauer brought this change] 6055 6056 ares_destroy() documentation: no new requests 6057 6058 Clarify that no new requests may be added to a resolver channel that is 6059 currently being destroyed. 6060 6061- [Alexander Klauer brought this change] 6062 6063 Documentation: properly document ARES_ECANCELLED 6064 6065 This commit clarifies the behaviour of ares_cancel() with respect to 6066 callbacks and adds missing documentation of ARES_ECANCELLED to the man 6067 pages of the affected functions. 6068 6069- [Alexander Klauer brought this change] 6070 6071 ares_cancel(): cancel requests safely 6072 6073 An invocation of ares_cancel() walks through the request list, calling 6074 the callbacks of all pending requests on a channel. Previously, if such 6075 a callback added a new request to the channel, the request list might 6076 not end up empty, causing an abort by assertion failure. The present 6077 commit ensures that precisely all requests present upon entry of 6078 ares_cancel() are cancelled, and that adding new requests through 6079 callbacks is safe. 6080 6081Yang Tse (10 Mar 2013) 6082- ares.h: stricter CARES_EXTERN linkage decorations logic 6083 6084 No API change involved. 6085 6086- ares_build.h.dist: enhance non-configure GCC ABI detection logic 6087 6088 GCC specific adjustments: 6089 6090 - check __ILP32__ before 32 and 64bit processor architectures in 6091 order to detect ILP32 programming model on 64 bit processors 6092 which, of course, also support LP64 programming model, when using 6093 gcc 4.7 or newer. 6094 6095 - keep 32bit processor architecture checks in order to support gcc 6096 versions older than 4.7 which don't define __ILP32__ 6097 6098 - check __LP64__ for gcc 3.3 and newer, while keeping 64bit processor 6099 architecture checks for older versions which don't define __LP64__ 6100 6101Daniel Stenberg (9 Mar 2013) 6102- ares.h: there is no ares_free_soa function 6103 6104Yang Tse (9 Mar 2013) 6105- Makefile.am: empty AM_LDFLAGS definition for automake 1.7 compatibility 6106 6107- ares_inet_ntop.3: s/socklen_t/ares_socklen_t 6108 6109- configure: use XC_LIBTOOL for portability across libtool versions 6110 6111- xc-lt-iface.m4: provide XC_LIBTOOL macro 6112 6113- Makefile.am: use AM_CPPFLAGS instead of INCLUDES 6114 6115- inet_ntop.c: s/socklen_t/ares_socklen_t 6116 6117- inet_ntop.c: s/socklen_t/ares_socklen_t for portability 6118 6119Daniel Stenberg (19 Feb 2013) 6120- ares.h: s/socklen_t/ares_socklen_t for portability 6121 6122- ares_inet_ntop.3: 4th argument is socklen_t! 6123 6124- spell inet correctly! 6125 6126- ares_inet_pton/ntop: cleanup 6127 6128 Make sure that the symbols are always exported and present in c-ares. 6129 6130 Make the headers prefixed with 'ares'. 6131 6132 Removed the inet_ntop.h version as it no longer features any content. 6133 6134- ares_inet_ntop/ares_inet_pton: added man pages 6135 6136Yang Tse (15 Feb 2013) 6137- [Gisle Vanem brought this change] 6138 6139 curl_setup_once.h: definition of HAVE_CLOSE_S defines sclose() to close_s() 6140 6141- [Gisle Vanem brought this change] 6142 6143 config-dos.h: define HAVE_CLOSE_S for MSDOS/Watt-32 6144 6145- [Gisle Vanem brought this change] 6146 6147 config-dos.h: define strerror() to strerror_s_() for High-C 6148 6149Daniel Stenberg (13 Feb 2013) 6150- ares_get_datatype: removed unused function 6151 6152 it was also wrongly named as internal functions require two underscores 6153 6154- ares__bitncmp: use two underscores for private functions 6155 6156 It used a single one previously making it look like a public one 6157 6158- ares__generate_new_id: moved to ares_query.c 6159 6160 ... and ares__rc4 is turned into a local static function. 6161 6162- ares__swap_lists: make private and static 6163 6164 ... since there's only one user, make it static within ares_process.c 6165 6166Yang Tse (13 Feb 2013) 6167- Makefile.msvc: add four VS version strings 6168 6169Daniel Stenberg (13 Feb 2013) 6170- ares_expand_name.3: clarify how to free the data 6171 6172Yang Tse (30 Jan 2013) 6173- zz40-xc-ovr.m4: fix 'wc' detection - follow-up 2 6174 6175 - Fix a pair of single quotes to double quotes. 6176 6177 URL: http://curl.haxx.se/mail/lib-2013-01/0355.html 6178 Reported by: Tor Arntsen 6179 6180- zz40-xc-ovr.m4: fix 'wc' detection - follow-up 6181 6182 - Take into account that 'wc' may return leading spaces and/or tabs. 6183 6184 - Set initial IFS to space, tab and newline. 6185 6186- zz40-xc-ovr.m4: fix 'wc' detection 6187 6188 - Take into account that 'wc' may return leading spaces. 6189 6190 - Set internationalization behavior variables. 6191 6192 Tor Arntsen analyzed and reported the issue. 6193 6194 URL: http://curl.haxx.se/mail/lib-2013-01/0351.html 6195 6196- zz40-xc-ovr.m4: check another three basic utilities 6197 6198- zz40-xc-ovr.m4: 1.0 interface stabilization 6199 6200 - Stabilization results in 4 public interface m4 macros: 6201 XC_CONFIGURE_PREAMBLE 6202 XC_CONFIGURE_PREAMBLE_VER_MAJOR 6203 XC_CONFIGURE_PREAMBLE_VER_MINOR 6204 XC_CHECK_PATH_SEPARATOR 6205 - Avoid one level of internal indirection 6206 - Update comments 6207 - Drop XC_OVR_ZZ40 macro 6208 6209- zz40-xc-ovr.m4: emit witness message in configure BODY 6210 6211 This avoids witness message in output when running configure --help, 6212 while sending the message to config.log for other configure runs. 6213 6214- zz40-xc-ovr.m4: truly do version conditional overriding 6215 6216 - version conditional overriding 6217 - catch unexpanded XC macros 6218 - fix double words in comments 6219 6220- zz40-xc-ovr.m4: fix variable assignment of subshell output bashism 6221 6222 Tor Arntsen analyzed and reported the issue. 6223 6224 URL: http://curl.haxx.se/mail/lib-2013-01/0306.html 6225 6226- zz40-xc-ovr.m4: reinstate strict AC_REQUIRE macro dependencies 6227