Commit graph

16 commits

Author SHA1 Message Date
Ondřej Surý
b009b3c50c Refactor the interface handling in the netmgr
The isc_nmiface_t type was holding just a single isc_sockaddr_t,
so we got rid of the datatype and use plain isc_sockaddr_t in place
where isc_nmiface_t was used before.  This means less type-casting and
shorter path to access isc_sockaddr_t members.

At the same time, instead of keeping the reference to the isc_sockaddr_t
that was passed to us when we start listening, we will keep a local
copy. This prevents the data race on destruction of the ns_interface_t
objects where pending nmsockets could reference the sockaddr of already
destroyed ns_interface_t object.

(cherry picked from commit 50270de8a0)
2021-05-26 10:09:47 +02:00
Michał Kępień
87f1db2ce4 Roll back unnecessary libtool updates
Commit a875dcc669 inadvertently included
libtool updates which were unrelated to the removal of custom SPNEGO
code.  Roll these updates back to avoid confusion.
2021-04-16 14:40:06 +02:00
Mark Andrews
a875dcc669 Remove custom ISC SPNEGO implementation
The custom ISC SPNEGO mechanism implementation is no longer needed on
the basis that all major Kerberos 5/GSSAPI (mit-krb5, heimdal and
Windows) implementations support SPNEGO mechanism since 2006.

This commit removes the custom ISC SPNEGO implementation, and removes
the option from both autoconf and win32 Configure script.  Unknown
options are being ignored, so this doesn't require any special handling.
2021-04-01 10:42:32 +02:00
Ondřej Surý
2f0f531ee8 Use library constructor/destructor to initialize OpenSSL
Instead of calling isc_tls_initialize()/isc_tls_destroy() explicitly use
gcc/clang attributes on POSIX and DLLMain on Windows to initialize and
shutdown OpenSSL library.

This resolves the issue when isc_nm_create() / isc_nm_destroy() was
called multiple times and it would call OpenSSL library destructors from
isc_nm_destroy().

At the same time, since we now have introduced the ctor/dtor for libisc,
this commit moves the isc_mem API initialization (the list of the
contexts) and changes the isc_mem_checkdestroyed() to schedule the
checking of memory context on library unload instead of executing the
code immediately.
2021-02-26 17:18:06 +01:00
Mark Andrews
0bcf09fe45 Fix linking order for OpenSSL libraries
As libssl depends on libcrypto, -lssl needs to precede -lcrypto in
linker invocations or else the build will fail with static OpenSSL
libraries.  Adjust m4/ax_check_openssl.m4 to prevent this issue from
getting triggered when pkg-config files for OpenSSL are not available.

(cherry picked from commit 9223c7d599)
2021-02-17 10:38:25 +11:00
Witold Kręcicki
012946eadc autoconf: link with libssl
This is prerequisite to adding DoT and DoH support to BIND 9.
2020-12-09 10:46:16 +01:00
Mark Andrews
a7be4e219e Wait for test instance of named to exit before completing subtest.
(cherry picked from commit dda5b7b0b8)
2020-09-10 20:13:03 +10:00
Ondřej Surý
d80b6ec879 Add PKG_CHECK_VAR and AS_VAR_COPY compat macros (Courtesy of ycflash) 2019-08-08 14:46:31 +02:00
Ondřej Surý
5d1e7be582 Rename OPENSSL_INCLUDES to OPENSSL_CFLAGS in AX_CHECK_OPENSSL() macro
The ax_check_openssl m4 macro used OPENSSL_INCLUDES.  Rename the
subst variable to OPENSSL_CFLAGS and wrap AX_CHECK_OPENSSL() in
action-if-not-found part of PKG_CHECK_MODULE check for libcrypto.
2019-06-25 12:36:01 +02:00
Ondřej Surý
a654756c3e Use couple more autoconf convenience macros to cleanup configure.ac
Pull and use several autoconf archive convenience macros to simplify
configure.ac.

* AX_CHECK_COMPILE_FLAG(FLAG, ...) - check whether given CFLAG works
* AX_CHECK_LINK_FLAG(FLAG, ...) - check whether given LDFLAG works
* AX_CHECK_PREPROC_FLAG(FLAG, ...) - check whether give CPPFLAG works
* AX_SAVE_FLAGS/AX_RESTORE_FLAGS - save and restore *FLAGS
2019-06-19 11:35:18 +02:00
Mark Andrews
8973d4bd16 add /opt/local to list of locations for OpenSSL 2019-06-04 03:58:25 -04:00
Ondřej Surý
cc0a3c5d3c Break out of loop when first POSIX-compatible shell is found 2018-12-18 13:02:00 +01:00
Ondřej Surý
54ff27a6bc Add and use AX_POSIX_SHELL autoconf macro, so we can rely on POSIX shell features 2018-11-08 02:52:19 +07:00
Ondřej Surý
c692da2182 Improve autoconf pthread detection 2018-08-16 17:18:52 +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ý
c3b8130fe8 Make OpenSSL mandatory 2018-07-19 12:47:03 -04:00