Commit Graph
11173 Commits
Author SHA1 Message Date
Ondřej Surý 3199fe73fe Remove non-stdatomic parts of rwlock.{c,h} 2018-08-08 09:49:06 +02:00
Ondřej Surý 56c3eaed07 Make lib/isc/stats.c lock-free 2018-08-08 09:49:06 +02:00
Ondřej Surý 5679ea9ab5 Enforce stdatomic.h usage 2018-08-08 09:49:06 +02:00
Ondřej Surý 72b6b211ad Reinstate isc_mempool 2018-08-08 09:49:06 +02:00
Ondřej Surý c2137dcf22 Replace the whole isc_mem and isc_mempool with just malloc/free 2018-08-08 09:49:06 +02:00
Ondřej Surý 19dd3df13e Properly call isc_refcount_destroy() immediately after isc_refcount_decrement() to limit the impact of memory ordering 2018-08-08 09:49:06 +02:00
Ondřej Surý 3081213672 The isc_refcount_decrement must use memory_order_release and isc_refcount_destroy must run thread barrier with memory_order_require 2018-08-08 09:49:06 +02:00
Ondřej Surý ca866e0ec2 isc_refcount_init() now doesn't return isc_result_t and asserts on failed initialization 2018-08-08 09:49:06 +02:00
Evan HuntandOndřej Surý b55338e447 Silence a compiler warning on openbsd and fix windows build 2018-08-08 02:49:28 -04:00
Michał Kępień 8e3fc5725f Extract code preparing a delegation response to a separate function
Changes introduced by the previous two commits make the parts of
query_delegation() and query_zone_delegation() which prepare a
delegation response functionally equivalent.  Extract this code into a
separate function, query_prepare_delegation_response(), and then call
the latter from both query_delegation() and query_zone_delegation() in
order to reduce code duplication.  Add a comment describing the purpose
of the extracted code.  Fix coding style issues.
2018-08-08 08:08:40 +02:00
Michał Kępień 7db4dedf6b Remove unused NS_QUERYATTR_CACHEGLUEOK query attribute
The NS_QUERYATTR_CACHEGLUEOK query attribute has no influence on query
processing.  Remove it.
2018-08-08 08:08:40 +02:00
Michał Kępień b6c77202cb Restore zone database and zone node if cache search results are to be ignored
When query processing hits a delegation from a locally configured zone,
an attempt may be made to look for a better answer in the cache.  In
such a case, the zone-sourced delegation data is set aside and the
lookup is retried using the cache database.  When that lookup is
completed, a decision is made whether the answer found in the cache is
better than the answer found in the zone.

Currently, if the zone-sourced answer turns out to be better than the
one found in the cache:

  - qctx->zdb is not restored into qctx->db,
  - qctx->node, holding the zone database node found, is not even saved.

Thus, in such a case both qctx->db and qctx->node will point at cache
data.  This is not an issue for BIND versions which do not support
mirror zones because in these versions non-recursive queries always
cause the zone-sourced delegation to be returned and thus the
non-recursive part of query_delegation() is never reached if the
delegation is coming from a zone.  With mirror zones, however,
non-recursive queries may cause cache lookups even after a zone
delegation is found.  Leaving qctx->db assigned to the cache database
when query_delegation() determines that the zone-sourced delegation is
the best answer to the client's query prevents DS records from being
added to delegations coming from mirror zones.  Fix this issue by
keeping the zone database and zone node in qctx while the cache is
searched for an answer and then restoring them into qctx->db and
qctx->node, respectively, if the zone-sourced delegation turns out to be
the best answer.  Since this change means that qctx->zdb cannot be used
as the glue database any more as it will be reset to NULL by RESTORE(),
ensure that qctx->db is not a cache database before attaching it to
qctx->client->query.gluedb.

Furthermore, current code contains a conditional statement which
prevents a mirror zone from being used as a source of glue records.
Said statement was added to prevent assertion failures caused by
attempting to use a zone database's glue cache for finding glue for an
NS RRset coming from a cache database.  However, that check is overly
strict since it completely prevents glue from being added to delegations
coming from mirror zones.  With the changes described above in place,
the scenario this check was preventing can no longer happen, so remove
the aforementioned check.

If qctx->zdb is not NULL, qctx->zfname will also not be NULL;
qctx->zsigrdataset may be NULL in such a case, but query_putrdataset()
handles pointers to NULL pointers gracefully.  Remove redundant
conditional expressions to make the cleanup code in query_freedata()
match the corresponding sequences of SAVE() / RESTORE() macros more
closely.
2018-08-08 08:07:46 +02:00
Ondřej Surý e3131b8d52 Make sure the storage for isc_random32() result is 32-bit long 2018-08-07 09:52:47 +02:00
Ondřej Surý e80c26b22e Define and use new DNS_RDATASET_COUNT_UNDEFINED equals ISC_UINT32_MAX to make the code more readable 2018-08-06 11:24:14 +02:00
Ondřej Surý 41a68425ea Refactor code around random/cyclic/fixed to reduce code duplication 2018-08-06 11:24:14 +02:00
Mark AndrewsandOndřej Surý f7986c8d1a Only get one random number per response when order == random 2018-08-05 07:23:07 +02:00
Mark Andrews 83a1e87dd2 remove dead code 2018-08-02 18:57:30 -04:00
Mark Andrews a94db46631 only check the bit map 2018-08-03 08:21:48 +10:00
Mark Andrews 9130f055f4 treat the signed instance of a inline zone as dynamic 2018-08-02 00:00:13 -04:00
Mark Andrews 12d45c5cd1 lower log level to debug(1) 2018-08-01 21:31:17 -04:00
Mark Andrews 57eadf4d4f handle dns_aclelementtype_geoip 2018-08-02 09:18:16 +10:00
Mark Andrews fb8bb4e306 test dns_acl_isinsecure with geoip element 2018-08-02 09:18:16 +10:00
Mark Andrews 63c9ec367f use tlsa and smime structs to set common values 2018-08-01 18:15:08 -04:00
Ondřej Surý 20faf4652a Change isc_buffer_reallocate() into a static functions as it is not used outside of isc_buffer_reserve() 2018-07-31 22:00:30 +02:00
Ondřej Surý 7785f644c3 Remove illogical condition from isc_buffer_reallocate that would return ISC_R_NOSPACE when requested size is less than available size 2018-07-31 22:00:30 +02:00
Ondřej Surý 519bfe4c97 Forbid isc_buffer_printf from growing the buffer unless auto reallocation is enabled 2018-07-31 22:00:30 +02:00
Mark Andrews 4093efc900 refcount errors on error paths 2018-07-31 17:41:45 +10:00
Mark Andrews 7671aba67d look for LIBRESSL_VERSION_NUMBER as well 2018-07-24 18:22:29 +10:00
Ondřej Surý 187d22e090 Link libiscc with OpenSSL to fix CRYPTO_memcmp symbol missing 2018-07-24 09:37:09 +02:00
Ondřej Surý 71877806e8 Fix ax_check_openssl to accept yes and improve it to modern autotools standard 2018-07-23 22:10:52 +02:00
Ondřej Surý 083461d332 Fix the isc_safe_memwipe() usage with (NULL, >0) 2018-07-20 10:08:24 -04:00
Ondřej Surý b105ccee68 Remove isc_safe_memcompare, it's not needed anywhere and can't be replaced with CRYPTO_memcmp() 2018-07-20 10:06:14 -04:00
Ondřej Surý 66ba2fdad5 Replace isc_safe routines with their OpenSSL counter parts 2018-07-20 00:34:26 -04:00
Mark AndrewsandOndřej Surý 4c3386ad95 remove lib/isc/print.c and lib/isc/tests/print_test.c 2018-07-19 23:24:28 -04:00
Ondřej Surý 83cde08522 Introduce USE_OPENSSL define to Windows build, remove CRYPTO and AES conditions. 2018-07-19 16:54:53 -04:00
Ondřej Surý 08974f39f1 Fix the Windows build 2018-07-19 14:00:40 -04:00
Ondřej Surý fc496b2b5d Fix DH and ECDSA algorithms in PKCS#11 build 2018-07-19 14:00:40 -04:00
Ondřej Surý 919179b369 Fix the build when EdDSA algorithms are not available 2018-07-19 13:17:38 -04:00
Ondřej Surý 0a73c9f137 Remove PKCS#11 DH implementation as there's no private keys stored in HSM for DH algorithm 2018-07-19 12:47:03 -04:00
Ondřej Surý 9d1f4696ec Disable DH test with PKCS#11 2018-07-19 12:47:03 -04:00
Ondřej Surý c3b8130fe8 Make OpenSSL mandatory 2018-07-19 12:47:03 -04:00
Mark Andrews 6e06d3e7c6 remove re-initalisation of common structure 2018-07-12 09:37:13 +10:00
Mark AndrewsandEvan Hunt 329a0e7812 Remove support for silently ignoring 'no-change' deltas from BIND 8 when processing an IXFR stream. 'no-change' deltas will now trigger a fallback to AXFR as the recovery mechanism. 2018-07-10 19:20:09 -07:00
Mark AndrewsandEvan Hunt 6eec7fe092 remove redundant test 2018-07-10 18:53:38 -07:00
Mark AndrewsandEvan Hunt 4f18b6a09a fix spelling of 'telemetry' 2018-07-10 18:19:12 -07:00
Mark AndrewsandEvan Hunt 69fd3f5ba4 use extracted netaddr rather than client->destaddr 2018-07-10 18:17:54 -07:00
Michał Kępień e5ef038134 Remove redundant dns_name_totextfilter_t argument
Since idn_output_filter() no longer uses its 'absolute' argument and no
other callback is used with dns_name_settotextfilter(), remove the
'absolute' argument from the dns_name_totextfilter_t prototype.
2018-07-10 14:34:35 +02:00
Mark AndrewsandWitold Krecicki 8ef23f9fb0 the presence of a DNAME record proves that the name does not exist in the zone but as we don't want to use that for NXDMOMAIN return DNS_R_DNAME from dns_nsec_noexistnodata 2018-07-10 03:20:21 -04:00
Witold Kręcicki 7f60bb39df Don't synthesize NXDOMAIN from NSEC for records under a DNAME 2018-07-10 03:20:21 -04:00
Tinderbox User b65d19f9fd prep 9.13.2 2018-07-03 07:40:29 +00:00