- 14 Feb, 2020 1 commit
-
-
Ondřej Surý authored
-
- 13 Feb, 2020 2 commits
-
-
Evan Hunt authored
-
Ondřej Surý authored
The command used to reformat the files in this commit was: ./util/run-clang-tidy \ -clang-tidy-binary clang-tidy-11 -clang-apply-replacements-binary clang-apply-replacements-11 \ -checks=-*,readability-braces-around-statements \ -j 9 \ -fix \ -format \ -style=file \ -quiet clang-format -i --style=format $(git ls-files '*.c' '*.h') uncrustify -c .uncrustify.cfg --replace --no-backup $(git ls-files '*.c' '*.h') clang-format -i --style=format $(git ls-files '*.c' '*.h')
-
- 12 Feb, 2020 1 commit
-
-
Ondřej Surý authored
-
- 03 Feb, 2020 2 commits
-
-
Ondřej Surý authored
The isc_buffer_allocate() function now cannot fail with ISC_R_MEMORY. This commit removes all the checks on the return code using the semantic patch from previous commit, as isc_buffer_allocate() now returns void.
-
Ondřej Surý authored
The isc_mempool_create() function now cannot fail with ISC_R_MEMORY. This commit removes all the checks on the return code using the semantic patch from previous commit, as isc_mempool_create() now returns void.
-
- 03 Dec, 2019 1 commit
-
-
Ondřej Surý authored
Previously, the dns_name API used isc_thread_key API for TLS, which is fairly complicated and requires initialization of memory contexts, etc. This part of code was refactored to use a ISC_THREAD_LOCAL pointer which greatly simplifies the whole code related to storing TLS variables.
-
- 07 Nov, 2019 1 commit
-
-
Evan Hunt authored
When a task manager is created, we can now specify an `isc_nm` object to associate with it; thereafter when the task manager is placed into exclusive mode, the network manager will be paused.
-
- 03 Oct, 2019 1 commit
-
-
Ondřej Surý authored
-
- 01 Oct, 2019 4 commits
-
-
Ondřej Surý authored
The coccinellery repository provides many little semantic patches to fix common problems in the code. The number of semantic patches in the coccinellery repository is high and most of the semantic patches apply only for Linux, so it doesn't make sense to run them on regular basis as the processing takes a lot of time. The list of issue found in BIND 9, by no means complete, includes: - double assignment to a variable - `continue` at the end of the loop - double checks for `NULL` - useless checks for `NULL` (cannot be `NULL`, because of earlier return) - using `0` instead of `NULL` - useless extra condition (`if (foo) return; if (!foo) { ...; }`) - removing & in front of static functions passed as arguments
-
Ondřej Surý authored
Use the semantic patch from the previous commit to replace all the calls to dns_name_copy() with NULL as third argument with dns_name_copynf().
-
Ondřej Surý authored
This commit was done by hand to add the RUNTIME_CHECK() around stray dns_name_copy() calls with NULL as third argument. This covers the edge cases that doesn't make sense to write a semantic patch since the usage pattern was unique or almost unique.
-
Ondřej Surý authored
This commit add RUNTIME_CHECK() around all simple dns_name_copy() calls where the third argument is NULL using the semantic patch from the previous commit.
-
- 30 Sep, 2019 2 commits
-
-
Petr Menšík authored
Warning is emitted before any dig headers.
-
Petr Menšík authored
It is possible dig used ACE encoded name in locale, which does not support converting it to unicode. Instead of fatal error, fallback to ACE name on output.
-
- 12 Sep, 2019 1 commit
-
-
Ondřej Surý authored
-
- 06 Sep, 2019 1 commit
-
-
Mark Andrews authored
-
- 03 Sep, 2019 2 commits
-
-
Diego dos Santos Fronza authored
-
Diego dos Santos Fronza authored
sources.
-
- 30 Aug, 2019 1 commit
-
-
Ondřej Surý authored
isc_event_allocate() calls isc_mem_get() to allocate the event structure. As isc_mem_get() cannot fail softly (e.g. it never returns NULL), the isc_event_allocate() cannot return NULL, hence we remove the (ret == NULL) handling blocks using the semantic patch from the previous commit.
-
- 28 Aug, 2019 1 commit
-
-
Mark Andrews authored
-
- 25 Aug, 2019 1 commit
-
-
Evan Hunt authored
-
- 23 Jul, 2019 1 commit
-
-
Ondřej Surý authored
-
- 22 May, 2019 1 commit
-
-
Mark Andrews authored
-
- 09 May, 2019 1 commit
-
-
Mark Andrews authored
-
- 07 May, 2019 1 commit
-
-
Mark Andrews authored
-
- 08 Mar, 2019 1 commit
-
-
Ondřej Surý authored
-
- 06 Feb, 2019 1 commit
-
-
Mark Andrews authored
the condition test for checking the client cookie value was wrong; don't call process_opt multiple times
-
- 25 Jan, 2019 1 commit
-
-
Michał Kępień authored
dig retries a TCP query when a server closes the connection prematurely. However, dig's exit code remains unaffected even if the second attempt to get a response also fails with the same error for the same lookup, which should not be the case. Ensure the exit code is updated appropriately when a retry triggered by a TCP EOF condition fails.
-
- 08 Jan, 2019 3 commits
-
-
Michał Kępień authored
When a query times out after a socket is created and associated with a given dig_query_t structure, calling isc_socket_cancel() causes connect_done() to be run, which in turn takes care of all necessary cleanups. However, certain errors (e.g. get_address() returning ISC_R_FAMILYNOSUPPORT) may prevent a TCP socket from being created in the first place. Since force_timeout() may be used in code handling such errors, connect_timeout() needs to properly clean up a TCP query which is not associated with any socket. Call clear_query() from connect_timeout() after attempting to send a TCP query to the next available server if the timed out query does not have a socket associated with it, in order to prevent dig from hanging indefinitely due to the dig_query_t structure not being detached from its parent dig_lookup_t structure.
-
Michał Kępień authored
When a query times out and another server is available for querying within the same lookup, the timeout handler - connect_timeout() - is responsible for sending the query to the next server. Extract the relevant part of connect_timeout() to a separate function in order to improve code readability.
-
Michał Kępień authored
Before commit c2ec022f, using the "-b" command line switch for dig did not disable use of the other address family than the one to which the address supplied to that option belonged to. Thus, bind9_getaddresses() could e.g. prepare an isc_sockaddr_t structure for an IPv6 address when an IPv4 address has been passed to the "-b" command line option. To avoid attempting the impossible (e.g. querying an IPv6 address from a socket bound to an IPv4 address), a certain code block in send_tcp_connect() checked whether the address family of the server to be queried was the same as the address family of the socket set up for sending that query; if there was a mismatch, that particular server address was skipped. Commit c2ec022f made bind9_getaddresses() fail upon an address family mismatch between the address the hostname passed to it resolved to and the address supplied to the "-b" command line option. Such failures were fatal to dig back then. Commit 7f658603 made bind9_getaddresses() failures non-fatal, but also ensured that a get_address() failure in send_tcp_connect() still causes the given query address to be skipped (and also made such failures trigger an early return from send_tcp_connect()). Summing up, the code block handling address family mismatches in send_tcp_connect() has been redundant since commit c2ec022f. Remove it.
-
- 22 Nov, 2018 2 commits
-
-
Witold Krecicki authored
- Make isc_mutexblock_init/destroy return void - Minor cleanups
-
Ondřej Surý authored
-
- 13 Nov, 2018 2 commits
-
-
Michał Kępień authored
In BIND 9.11 and earlier, dig and similar tools used liblwres for parsing /etc/resolv.conf. After getting a list of servers from liblwres, a tool would check the address family of each server found and reject those unusable. When the resulting list of usable servers was empty, localhost addresses were queried as a fallback. When liblwres was removed in BIND 9.12, dig and similar tools were updated to parse /etc/resolv.conf using libirs instead. As part of that process, the localhost fallback was removed from bin/dig/dighost.c since the localhost fallback built into libirs was deemed to be sufficient. However, libirs only falls back to localhost if it does not find any name servers at all; if it does find any valid nameserver entry in /etc/resolv.conf, it just returns it to the caller because it is oblivious to whether the caller supports IPv4 and/or IPv6 or not. The code in bin/dig/dighost.c subsequently filters the returned list of servers in get_server_list() according to the requested address family restrictions. This may result in none of the addresses returned by libirs being usable, in which case a tool will attempt to work with an empty server list, causing a hang and subsequently a crash upon user interruption. Restore the localhost fallback in bin/dig/dighost.c to prevent the aforementioned hangs and crashes and ensure recent BIND versions behave identically to the older ones in the circumstances described above.
-
Michał Kępień authored
If a tool using the routines defined in bin/dig/dighost.c is sent an interruption signal around the time a connection timeout is scheduled to fire, connect_timeout() may be executed after destroy_libs() detaches from the global task (setting 'global_task' to NULL), which results in a crash upon a UDP retry due to bringup_timer() attempting to create a timer with 'task' set to NULL. Fix by preventing connect_timeout() from attempting a retry when shutdown is in progress.
-
- 08 Nov, 2018 2 commits
-
-
Ondřej Surý authored
-
Ondřej Surý authored
While implementing the new unit testing framework cmocka, it was found that the BIND 9 code doesn't compile when assertions are disabled or replaced with any function (such as mock_assert() from cmocka unit testing framework) that's not directly recognized as assertion by the compiler. This made the compiler to complain about blocks of code that was recognized as unreachable before, but now it isn't. The changes in this commit include: * assigns default values to couple of local variables, * moves some return statements around INSIST assertions, * adds __builtin_unreachable(); annotations after some INSIST assertions, * fixes one broken assertion (= instead of ==)
-
- 07 Nov, 2018 1 commit
-
-
Witold Krecicki authored
-
- 06 Nov, 2018 1 commit
-
-
Ondřej Surý authored
-