From 73435389ed2274c01c77a5fdbc7bea92ec00f817 Mon Sep 17 00:00:00 2001 From: Anthony Hu Date: Mon, 20 Jun 2022 16:33:04 -0400 Subject: [PATCH] Fix missing WOLFSSL_DTLS in Micrium build --- src/wolfio.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/wolfio.c b/src/wolfio.c index 34a0742fc..8f1c13050 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -2182,20 +2182,24 @@ int MicriumReceiveFrom(WOLFSSL *ssl, char *buf, int sz, void *ctx) NET_SOCK_ADDR_LEN peerSz = sizeof(peer); NET_SOCK_RTN_CODE ret; NET_ERR err; - int dtls_timeout = wolfSSL_dtls_get_current_timeout(ssl); WOLFSSL_ENTER("MicriumReceiveFrom()"); - if (ssl->options.handShakeDone) - dtls_timeout = 0; +#ifdef WOLFSSL_DTLS + { + int dtls_timeout = wolfSSL_dtls_get_current_timeout(ssl); + if (ssl->options.handShakeDone) + dtls_timeout = 0; - if (!wolfSSL_dtls_get_using_nonblock(ssl)) { - /* needs timeout in milliseconds */ - NetSock_CfgTimeoutRxQ_Set(sd, dtls_timeout * 1000, &err); - if (err != NET_SOCK_ERR_NONE) { - WOLFSSL_MSG("NetSock_CfgTimeoutRxQ_Set failed"); + if (!wolfSSL_dtls_get_using_nonblock(ssl)) { + /* needs timeout in milliseconds */ + NetSock_CfgTimeoutRxQ_Set(sd, dtls_timeout * 1000, &err); + if (err != NET_SOCK_ERR_NONE) { + WOLFSSL_MSG("NetSock_CfgTimeoutRxQ_Set failed"); + } } } +#endif ret = NetSock_RxDataFrom(sd, buf, sz, ssl->rflags, &peer, &peerSz, 0, 0, 0, &err);