From: Jan Hak Date: Fri, 19 Mar 2021 09:28:32 +0000 (+0100) Subject: kdig: tls tfo fix missing include file X-Git-Tag: v3.1.0~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27900dcc3a166c2f0bcb3c33f4da89f3a5afffd0;p=thirdparty%2Fknot-dns.git kdig: tls tfo fix missing include file --- diff --git a/src/utils/common/tls.c b/src/utils/common/tls.c index e58a4c504d..1328927c5c 100644 --- a/src/utils/common/tls.c +++ b/src/utils/common/tls.c @@ -22,7 +22,10 @@ #include #include #include +#define GNUTLS_VERSION_FASTOPEN_READY 0x030503 +#if GNUTLS_VERSION_NUMBER >= GNUTLS_VERSION_FASTOPEN_READY #include +#endif #include "utils/common/tls.h" #include "utils/common/cert.h" @@ -525,12 +528,19 @@ int tls_ctx_connect(tls_ctx_t *ctx, int sockfd, const char *remote, bool fastope } gnutls_session_set_ptr(ctx->session, ctx); + if (fastopen) { +#if GNUTLS_VERSION_NUMBER >= GNUTLS_VERSION_FASTOPEN_READY gnutls_transport_set_fastopen(ctx->session, sockfd, (struct sockaddr *)addr, sockaddr_len(addr), 0); +#else + gnutls_deinit(ctx->session); + return KNOT_ENOTSUP; +#endif } else { gnutls_transport_set_int(ctx->session, sockfd); } + gnutls_handshake_set_timeout(ctx->session, 1000 * ctx->wait); if (protocol != NULL) {