Compare commits

..

No commits in common. "f97ee14b69e301a7b5d9e5d682e99a0828f0658a" and "dc5026f2c85c6428ee85dcf9efb06c642e9f0b27" have entirely different histories.

11 changed files with 329 additions and 415 deletions

View File

@ -686,6 +686,9 @@ if (NOT HAVE_SSL_DANE_ENABLE)
target_include_directories(getdns_objects PRIVATE src/ssl_dane) target_include_directories(getdns_objects PRIVATE src/ssl_dane)
set(USE_DANESSL 1) set(USE_DANESSL 1)
endif () endif ()
if (Libidn_FOUND)
target_include_directories(getdns_objects PRIVATE ${LIBIDN_INCLUDE_DIR})
endif ()
if (Libidn2_FOUND) if (Libidn2_FOUND)
target_include_directories(getdns_objects PRIVATE ${LIBIDN2_INCLUDE_DIR}) target_include_directories(getdns_objects PRIVATE ${LIBIDN2_INCLUDE_DIR})
endif () endif ()
@ -719,6 +722,9 @@ if (ENABLE_STATIC)
if (Libunbound_FOUND) if (Libunbound_FOUND)
target_link_libraries(getdns PUBLIC Libunbound::Libunbound) target_link_libraries(getdns PUBLIC Libunbound::Libunbound)
endif () endif ()
if (Libidn_FOUND)
target_link_libraries(getdns PUBLIC Libidn::Libidn)
endif ()
if (Libidn2_FOUND) if (Libidn2_FOUND)
target_link_libraries(getdns PUBLIC Libidn2::Libidn2) target_link_libraries(getdns PUBLIC Libidn2::Libidn2)
endif () endif ()
@ -748,6 +754,9 @@ if (ENABLE_SHARED)
if (Libunbound_FOUND) if (Libunbound_FOUND)
target_link_libraries(getdns_shared PUBLIC Libunbound::Libunbound) target_link_libraries(getdns_shared PUBLIC Libunbound::Libunbound)
endif () endif ()
if (Libidn_FOUND)
target_link_libraries(getdns_shared PUBLIC Libidn::Libidn)
endif ()
if (Libidn2_FOUND) if (Libidn2_FOUND)
target_link_libraries(getdns_shared PUBLIC Libidn2::Libidn2) target_link_libraries(getdns_shared PUBLIC Libidn2::Libidn2)
endif () endif ()

View File

@ -2,9 +2,6 @@
* Always send the `dot` ALPN when using DoT * Always send the `dot` ALPN when using DoT
* Strengthen version determination for Libidn2 during cmake processing (thanks * Strengthen version determination for Libidn2 during cmake processing (thanks
jpbion). jpbion).
* Fix for issue in UDP stream selection in case of timeouts.
Thanks Shikha Sharma
* Fix using asterisk in ipstr for any address. Thanks uzlonewolf.
* 2021-06-04: Version 1.7.0 * 2021-06-04: Version 1.7.0
* Make TLS Handshake timeout max 4/5th of timeout for the query, * Make TLS Handshake timeout max 4/5th of timeout for the query,

View File

@ -28,18 +28,6 @@ This module will set the following variables in your project:
#]=======================================================================] #]=======================================================================]
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgCheck IMPORTED_TARGET GLOBAL check)
endif ()
if (PkgCheck_FOUND)
set(CHECK_INCLUDE_DIR ${PkgCheck_INCLUDE_DIRS} CACHE FILEPATH "check include path")
set(CHECK_LIBRARIES ${PkgCheck_LIBRARIES} CACHE STRING "check libraries")
set(CHECK_VERSION ${PkgCheck_VERSION})
add_library(Check::Check ALIAS PkgConfig::PkgCheck)
set(Check_FOUND ON)
else ()
find_path(CHECK_INCLUDE_DIR check.h find_path(CHECK_INCLUDE_DIR check.h
HINTS HINTS
"${CHECK_DIR}" "${CHECK_DIR}"
@ -62,7 +50,7 @@ else ()
) )
endif () endif ()
set(_CHECK_LIBARIES "") set(CHECK_LIBRARIES "")
# Check may need the math, subunit and rt libraries on Unix # Check may need the math, subunit and rt libraries on Unix
if (UNIX) if (UNIX)
@ -71,18 +59,16 @@ else ()
find_library(CHECK_SUBUNIT_LIBRARY subunit) find_library(CHECK_SUBUNIT_LIBRARY subunit)
if (CHECK_MATH_LIBRARY) if (CHECK_MATH_LIBRARY)
list(APPEND _CHECK_LIBARIES "${CHECK_MATH_LIBRARY}") list(APPEND CHECK_LIBRARIES "${CHECK_MATH_LIBRARY}")
endif () endif ()
if (CHECK_RT_LIBRARY) if (CHECK_RT_LIBRARY)
list(APPEND _CHECK_LIBARIES "${CHECK_RT_LIBRARY}") list(APPEND CHECK_LIBRARIES "${CHECK_RT_LIBRARY}")
endif () endif ()
if (CHECK_SUBUNIT_LIBRARY) if (CHECK_SUBUNIT_LIBRARY)
list(APPEND _CHECK_LIBARIES "${CHECK_SUBUNIT_LIBRARY}") list(APPEND CHECK_LIBRARIES "${CHECK_SUBUNIT_LIBRARY}")
endif () endif ()
endif() endif()
set(CHECK_LIBRARIES ${_CHECK_LIBARIES} ${CHECK_LIBRARY} CACHE STRING "check libraries")
if (CHECK_INCLUDE_DIR AND CHECK_LIBRARY) if (CHECK_INCLUDE_DIR AND CHECK_LIBRARY)
if (NOT TARGET Check::Check) if (NOT TARGET Check::Check)
add_library(Check::Check UNKNOWN IMPORTED) add_library(Check::Check UNKNOWN IMPORTED)
@ -108,7 +94,5 @@ else ()
VERSION_VAR CHECK_VERSION VERSION_VAR CHECK_VERSION
) )
endif()
mark_as_advanced(CHECK_INCLUDE_DIR CHECK_LIBRARIES CHECK_LIBRARY mark_as_advanced(CHECK_INCLUDE_DIR CHECK_LIBRARIES CHECK_LIBRARY
CHECK_MATH_LIBRARY CHECK_RT_LIBRARY CHECK_SUBUNIT_LIBRARY) CHECK_MATH_LIBRARY CHECK_RT_LIBRARY CHECK_SUBUNIT_LIBRARY)

View File

@ -30,20 +30,6 @@ This module will set the following variables in your project:
#]=======================================================================] #]=======================================================================]
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgGnuTLS IMPORTED_TARGET GLOBAL QUIET gnutls)
pkg_check_modules(PkgGnuTLSDane IMPORTED_TARGET GLOBAL QUIET gnutls-dane)
endif ()
if (PkgGnuTLS_FOUND AND PkgGnuTLSDane_FOUND)
set(GNUTLS_INCLUDE_DIR ${PkgGnuTLS_INCLUDE_DIRS} $PkgGnuTLSDane_INCLUDE_DIRS} CACHE FILEPATH "GnuTLS include path")
set(NETTLE_LIBRARIES ${PkgGnuTLS_LIBRARIES} ${PkgGnuTLSDane_LIBRARIES} CACHE STRING "GnuTLS libraries")
set(NETTLE_VERSION ${PkgGnuTLS_VERSION})
add_library(GnuTLS::GnuTLS ALIAS PkgConfig::PkgGnuTLS)
add_library(GnuTLS::Dane ALIAS PkgConfig::PkgGnuTLSDane)
set(GnuTLS_FOUND ON)
else ()
find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h
HINTS HINTS
"${GNUTLS_DIR}" "${GNUTLS_DIR}"
@ -62,7 +48,7 @@ else ()
"${GNUTLS_DIR}/lib" "${GNUTLS_DIR}/lib"
) )
set(_GNUTLS_LIBRARIES "") set(GNUTLS_LIBRARIES "")
if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY AND GNUTLS_DANE_LIBRARY) if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY AND GNUTLS_DANE_LIBRARY)
if (NOT TARGET GnuTLS::GnuTLS) if (NOT TARGET GnuTLS::GnuTLS)
@ -88,14 +74,12 @@ else ()
endif () endif ()
endif() endif()
list(APPEND _GNUTLS_LIBRARIES "${GNUTLS_LIBRARY}" "${GNUTLS_DANE_LIBRARY}") list(APPEND GNUTLS_LIBRARIES "${GNUTLS_LIBRARY}" "${GNUTLS_DANE_LIBRARY}")
set(GNUTLS_LIBRARIES ${_GNUTLS_LIBRARIES} CACHE STRING "GnuTLS libraries")
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GnuTLS find_package_handle_standard_args(GnuTLS
REQUIRED_VARS GNUTLS_LIBRARIES GNUTLS_INCLUDE_DIR REQUIRED_VARS GNUTLS_LIBRARIES GNUTLS_INCLUDE_DIR
VERSION_VAR GNUTLS_VERSION VERSION_VAR GNUTLS_VERSION
) )
endif ()
mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARIES GNUTLS_LIBRARY GNUTLS_DANE_LIBRARY) mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARIES GNUTLS_LIBRARY GNUTLS_DANE_LIBRARY)

View File

@ -28,37 +28,27 @@ This module will set the following variables in your project:
#]=======================================================================] #]=======================================================================]
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgLibevent IMPORTED_TARGET GLOBAL QUIET libevent>=2)
endif ()
if (PkgLibevent_FOUND)
set(LIBEVENT2_INCLUDE_DIR ${PkgLibevent_INCLUDE_DIRS} CACHE FILEPATH "libevent2 include path")
set(LIBEVENT2_LIBRARIES ${PkgLibevent_LIBRARIES} CACHE STRING "libevent2 libraries")
set(LIBEVENT2_VERSION ${PkgLibevent_VERSION})
add_library(Libevent2::Libevent_core ALIAS PkgConfig::PkgLibevent)
set(Libevent2_FOUND ON)
else ()
find_path(LIBEVENT2_INCLUDE_DIR event2/event.h find_path(LIBEVENT2_INCLUDE_DIR event2/event.h
HINTS HINTS
"${LIBEVENT2_DIR}" "${LIBEVENT2_DIR}"
"${LIBEVENT2_DIR}/include" "${LIBEVENT2_DIR}/include"
) )
find_library(LIBEVENT2_LIBRARIES NAMES event_core libevent_core find_library(LIBEVENT2_LIBRARY NAMES event_core libevent_core
HINTS HINTS
"${LIBEVENT2_DIR}" "${LIBEVENT2_DIR}"
"${LIBEVENT2_DIR}/lib" "${LIBEVENT2_DIR}/lib"
) )
if (LIBEVENT2_INCLUDE_DIR AND LIBEVENT2_LIBRARIES) set(LIBEVENT2_LIBRARIES "")
if (LIBEVENT2_INCLUDE_DIR AND LIBEVENT2_LIBRARY)
if (NOT TARGET Libevent2::Libevent_core) if (NOT TARGET Libevent2::Libevent_core)
add_library(Libevent2::Libevent_core UNKNOWN IMPORTED) add_library(Libevent2::Libevent_core UNKNOWN IMPORTED)
set_target_properties(Libevent2::Libevent_core PROPERTIES set_target_properties(Libevent2::Libevent_core PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBEVENT2_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${LIBEVENT2_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${LIBEVENT2_LIBRARIES}" IMPORTED_LOCATION "${LIBEVENT2_LIBRARY}"
) )
endif () endif ()
@ -68,11 +58,12 @@ else ()
endif () endif ()
endif() endif()
list(APPEND LIBEVENT2_LIBRARIES "${LIBEVENT2_LIBRARY}")
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libevent2 find_package_handle_standard_args(Libevent2
REQUIRED_VARS LIBEVENT2_LIBRARIES LIBEVENT2_INCLUDE_DIR REQUIRED_VARS LIBEVENT2_LIBRARIES LIBEVENT2_INCLUDE_DIR
VERSION_VAR LIBEVENT2_VERSION VERSION_VAR LIBEVENT2_VERSION
) )
endif ()
mark_as_advanced(LIBEVENT2_INCLUDE_DIR LIBEVENT2_LIBRARIES) mark_as_advanced(LIBEVENT2_INCLUDE_DIR LIBEVENT2_LIBRARIES LIBEVENT2_LIBRARY)

View File

@ -28,37 +28,27 @@ This module will set the following variables in your project:
#]=======================================================================] #]=======================================================================]
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgLibIdn2 IMPORTED_TARGET GLOBAL libidn2)
endif ()
if (PkgLibIdn2_FOUND)
set(LIBIDN2_INCLUDE_DIR ${PkgLibIdn2_INCLUDE_DIRS} CACHE FILEPATH "libidn2 include path")
set(LIBIDN2_LIBRARIES ${PkgLibIdn2_LIBRARIES} CACHE STRING "libidn2 libraries")
set(LIBIDN2_VERSION ${PkgLibIdn2_VERSION})
add_library(Libidn2::Libidn2 ALIAS PkgConfig::PkgLibIdn2)
set(Libidn2_FOUND ON)
else ()
find_path(LIBIDN2_INCLUDE_DIR idn2.h find_path(LIBIDN2_INCLUDE_DIR idn2.h
HINTS HINTS
"${LIBIDN2_DIR}" "${LIBIDN2_DIR}"
"${LIBIDN2_DIR}/include" "${LIBIDN2_DIR}/include"
) )
find_library(LIBIDN2_LIBRARIES NAMES idn2 libidn2 find_library(LIBIDN2_LIBRARY NAMES idn2 libidn2
HINTS HINTS
"${LIBIDN2_DIR}" "${LIBIDN2_DIR}"
"${LIBIDN2_DIR}/lib" "${LIBIDN2_DIR}/lib"
) )
if (LIBIDN2_INCLUDE_DIR AND LIBIDN2_LIBRARIES) set(LIBIDN2_LIBRARIES "")
if (LIBIDN2_INCLUDE_DIR AND LIBIDN2_LIBRARY)
if (NOT TARGET Libidn2::Libidn2) if (NOT TARGET Libidn2::Libidn2)
add_library(Libidn2::Libidn2 UNKNOWN IMPORTED) add_library(Libidn2::Libidn2 UNKNOWN IMPORTED)
set_target_properties(Libidn2::Libidn2 PROPERTIES set_target_properties(Libidn2::Libidn2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBIDN2_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${LIBIDN2_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${LIBIDN2_LIBRARIES}" IMPORTED_LOCATION "${LIBIDN2_LIBRARY}"
) )
endif () endif ()
@ -67,11 +57,13 @@ else ()
string(REGEX REPLACE "^.*IDN2_VERSION[ \t]+\"([0-9.]+)\".*$" "\\1" LIBIDN2_VERSION "${LIBIDN2_H}") string(REGEX REPLACE "^.*IDN2_VERSION[ \t]+\"([0-9.]+)\".*$" "\\1" LIBIDN2_VERSION "${LIBIDN2_H}")
endif () endif ()
endif() endif()
list(APPEND LIBIDN2_LIBRARIES "${LIBIDN2_LIBRARY}")
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libidn2 find_package_handle_standard_args(Libidn2
REQUIRED_VARS LIBIDN2_LIBRARIES LIBIDN2_INCLUDE_DIR REQUIRED_VARS LIBIDN2_LIBRARIES LIBIDN2_INCLUDE_DIR
VERSION_VAR LIBIDN2_VERSION VERSION_VAR LIBIDN2_VERSION
) )
endif ()
mark_as_advanced(LIBIDN2_INCLUDE_DIR LIBIDN2_LIBRARIES) mark_as_advanced(LIBIDN2_INCLUDE_DIR LIBIDN2_LIBRARIES LIBIDN2_LIBRARY)

View File

@ -28,18 +28,6 @@ This module will set the following variables in your project:
#]=======================================================================] #]=======================================================================]
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgLibunbound IMPORTED_TARGET GLOBAL QUIET libunbound)
endif ()
if (PkgLibunbound_FOUND)
set(LIBUNBOUND_INCLUDE_DIR ${PkgLibunbound_INCLUDE_DIRS} CACHE FILEPATH "libunbound include path")
set(LIBUNBOUND_LIBRARIES ${PkgLibunbound_LIBRARIES} CACHE STRING "libunbound libraries")
set(LIBUNBOUND_VERSION ${PkgLibunbound_VERSION})
add_library(Libunbound::Libunbound ALIAS PkgConfig::PkgLibunbound)
set(Libunbound_FOUND ON)
else ()
find_path(LIBUNBOUND_INCLUDE_DIR unbound.h find_path(LIBUNBOUND_INCLUDE_DIR unbound.h
HINTS HINTS
"${LIBUNBOUND_DIR}" "${LIBUNBOUND_DIR}"
@ -52,14 +40,14 @@ else ()
"${LIBUNBOUND_DIR}/lib" "${LIBUNBOUND_DIR}/lib"
) )
set(_LIBUNBOUND_LIBRARIES "") set(LIBUNBOUND_LIBRARIES "")
if (UNIX) if (UNIX)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)
list(APPEND _LIBUNBOUND_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}") list(APPEND LIBUNBOUND_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
list(APPEND _LIBUNBOUND_LIBRARIES "${OPENSSL_LIBRARIES}") list(APPEND LIBUNBOUND_LIBRARIES "${OPENSSL_LIBRARIES}")
endif() endif()
if (LIBUNBOUND_INCLUDE_DIR AND LIBUNBOUND_LIBRARY) if (LIBUNBOUND_INCLUDE_DIR AND LIBUNBOUND_LIBRARY)
@ -91,14 +79,12 @@ else ()
endif () endif ()
endif() endif()
list(APPEND _LIBUNBOUND_LIBRARIES "${LIBUNBOUND_LIBRARY}") list(APPEND LIBUNBOUND_LIBRARIES "${LIBUNBOUND_LIBRARY}")
set(LIBUNBOUND_LIBRARIES ${_LIBUNBOUND_LIBRARIES} CACHE STRING "libunbound libraries")
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libunbound find_package_handle_standard_args(Libunbound
REQUIRED_VARS LIBUNBOUND_LIBRARIES LIBUNBOUND_INCLUDE_DIR REQUIRED_VARS LIBUNBOUND_LIBRARIES LIBUNBOUND_INCLUDE_DIR
VERSION_VAR LIBUNBOUND_VERSION VERSION_VAR LIBUNBOUND_VERSION
) )
endif ()
mark_as_advanced(LIBUNBOUND_INCLUDE_DIR LIBUNBOUND_LIBRARIES LIBUNBOUND_LIBRARY) mark_as_advanced(LIBUNBOUND_INCLUDE_DIR LIBUNBOUND_LIBRARIES LIBUNBOUND_LIBRARY)

View File

@ -28,37 +28,27 @@ This module will set the following variables in your project:
#]=======================================================================] #]=======================================================================]
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgLibuv IMPORTED_TARGET GLOBAL libuv)
endif ()
if (PkgLibuv_FOUND)
set(LIBUV_INCLUDE_DIR ${PkgLibuv_INCLUDE_DIRS} CACHE FILEPATH "libuv include path")
set(LIBUV_LIBRARIES ${PkgLibuv_LIBRARIES} CACHE STRING "libuv libraries")
set(LIBUV_VERSION ${PkgLibuv_VERSION})
add_library(Libuv::Libuv ALIAS PkgConfig::PkgLibuv)
set(Libuv_FOUND ON)
else ()
find_path(LIBUV_INCLUDE_DIR uv.h find_path(LIBUV_INCLUDE_DIR uv.h
HINTS HINTS
"${LIBUV_DIR}" "${LIBUV_DIR}"
"${LIBUV_DIR}/include" "${LIBUV_DIR}/include"
) )
find_library(LIBUV_LIBRARIES NAMES uv libuv find_library(LIBUV_LIBRARY NAMES uv libuv
HINTS HINTS
"${LIBUV_DIR}" "${LIBUV_DIR}"
"${LIBUV_DIR}/lib" "${LIBUV_DIR}/lib"
) )
set(LIBUV_LIBRARIES "")
if (LIBUV_INCLUDE_DIR AND LIBUV_LIBRARY) if (LIBUV_INCLUDE_DIR AND LIBUV_LIBRARY)
if (NOT TARGET Libuv::Libuv) if (NOT TARGET Libuv::Libuv)
add_library(Libuv::Libuv UNKNOWN IMPORTED) add_library(Libuv::Libuv UNKNOWN IMPORTED)
set_target_properties(Libuv::Libuv PROPERTIES set_target_properties(Libuv::Libuv PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBUV_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${LIBUV_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${LIBUV_LIBRARIES}" IMPORTED_LOCATION "${LIBUV_LIBRARY}"
) )
endif () endif ()
@ -72,11 +62,12 @@ else ()
endif () endif ()
endif() endif()
list(APPEND LIBUV_LIBRARIES "${LIBUV_LIBRARY}")
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libuv find_package_handle_standard_args(Libuv
REQUIRED_VARS LIBUV_LIBRARIES LIBUV_INCLUDE_DIR REQUIRED_VARS LIBUV_LIBRARIES LIBUV_INCLUDE_DIR
VERSION_VAR LIBUV_VERSION VERSION_VAR LIBUV_VERSION
) )
endif ()
mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARIES) mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARIES LIBUV_LIBRARY)

View File

@ -30,20 +30,6 @@ This module will set the following variables in your project:
#]=======================================================================] #]=======================================================================]
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PkgNettle IMPORTED_TARGET GLOBAL nettle)
pkg_check_modules(PkgHogweed IMPORTED_TARGET GLOBAL QUIET hogweed)
endif()
if(PkgNettle_FOUND AND PkHogweed_FOUND)
set(NETTLE_INCLUDE_DIR ${PkgNettle_INCLUDE_DIRS} ${PkgHogweed_INCLUDE_DIRS} CACHE FILEPATH "Nettle include path")
set(NETTLE_LIBRARIES ${PkgNettle_LIBRARIES} ${PkgHogweed_LIBRARIES} CACHE STRING "Nettle libraries")
set(NETTLE_VERSION ${PkgNettle_VERSION})
add_library(Nettle::Nettle ALIAS PkgConfig::PkgNettle)
add_library(Nettle::Hogweed ALIAS PkgConfig::PkgHogweed)
set(Nettle_FOUND ON)
else()
find_path(NETTLE_INCLUDE_DIR nettle/version.h find_path(NETTLE_INCLUDE_DIR nettle/version.h
HINTS HINTS
"${NETTLE_DIR}" "${NETTLE_DIR}"
@ -62,17 +48,16 @@ else()
"${NETTLE_DIR}/lib" "${NETTLE_DIR}/lib"
) )
set(_NETTLE_LIBRARIES ${NETTLE_LIBRARY} ${HOGWEED_LIBRARY}) set(NETTLE_LIBRARIES "")
# May need gmp library on Unix. # May need gmp library on Unix.
if (UNIX) if (UNIX)
find_library(NETTLE_GMP_LIBRARY gmp) find_library(NETTLE_GMP_LIBRARY gmp)
endif ()
if (NETTLE_GMP_LIBRARY)
list(APPEND _NETTLE_LIBRARIES "${NETTLE_GMP_LIBRARY}")
endif ()
set(NETTLE_LIBRARIES ${_NETTLE_LIBRARIES} CACHE STRING "nettle libraries")
if (NETTLE_GMP_LIBRARY)
list(APPEND NETTLE_LIBRARIES "${NETTLE_GMP_LIBRARY}")
endif ()
endif ()
if (NETTLE_INCLUDE_DIR AND NETTLE_LIBRARY AND HOGWEED_LIBRARY) if (NETTLE_INCLUDE_DIR AND NETTLE_LIBRARY AND HOGWEED_LIBRARY)
if (NOT TARGET Nettle::Nettle) if (NOT TARGET Nettle::Nettle)
@ -106,6 +91,5 @@ else()
REQUIRED_VARS NETTLE_LIBRARIES NETTLE_INCLUDE_DIR REQUIRED_VARS NETTLE_LIBRARIES NETTLE_INCLUDE_DIR
VERSION_VAR NETTLE_VERSION VERSION_VAR NETTLE_VERSION
) )
endif()
mark_as_advanced(NETTLE_INCLUDE_DIR NETTLE_LIBRARIES NETTLE_LIBRARY HOGWEED_LIBRARY NETTLE_GMP_LIBRARY) mark_as_advanced(NETTLE_INCLUDE_DIR NETTLE_LIBRARIES NETTLE_LIBRARY HOGWEED_LIBRARY)

View File

@ -1189,7 +1189,7 @@ _getdns_ipaddr_dict_mf(struct mem_funcs *mf, const char *ipstr)
tsig_name_str = ""; tsig_name_str = "";
} }
} }
if (*ipstr == '*' && *(ipstr+1) == '\0') { if (*ipstr == '*') {
getdns_dict_util_set_string(r, "address_type", "IPv6"); getdns_dict_util_set_string(r, "address_type", "IPv6");
addr.size = 16; addr.size = 16;
(void) memset(buf, 0, 16); (void) memset(buf, 0, 16);

View File

@ -709,8 +709,6 @@ static void
stub_timeout_cb(void *userarg) stub_timeout_cb(void *userarg)
{ {
getdns_network_req *netreq = (getdns_network_req *)userarg; getdns_network_req *netreq = (getdns_network_req *)userarg;
getdns_upstream *upstream = netreq? netreq->upstream: NULL;
getdns_upstreams *upstreams = upstream? upstream->upstreams: NULL;
DEBUG_STUB("%s %-35s: MSG: %p\n", DEBUG_STUB("%s %-35s: MSG: %p\n",
STUB_DEBUG_CLEANUP, __FUNC__, (void*)netreq); STUB_DEBUG_CLEANUP, __FUNC__, (void*)netreq);
stub_cleanup(netreq); stub_cleanup(netreq);
@ -725,8 +723,6 @@ stub_timeout_cb(void *userarg)
"%-40s : Upstream : UDP - Resps=%6d, Timeouts =%6d (logged every 100 responses)\n", "%-40s : Upstream : UDP - Resps=%6d, Timeouts =%6d (logged every 100 responses)\n",
netreq->upstream->addr_str, netreq->upstream->addr_str,
(int)netreq->upstream->udp_responses, (int)netreq->upstream->udp_timeouts); (int)netreq->upstream->udp_responses, (int)netreq->upstream->udp_timeouts);
/* Only choose next stream if the timeout is on current UDP stream */
if (upstreams && (upstream == &upstreams->upstreams[upstreams->current_udp]))
stub_next_upstream(netreq); stub_next_upstream(netreq);
} else { } else {
netreq->upstream->responses_timeouts++; netreq->upstream->responses_timeouts++;