From fbd7f7972bd52ee8e78dd6ee71b02da888943fc8 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Tue, 31 Jan 2017 15:11:34 -0800 Subject: [PATCH] Multicast 1. Used quotes rather than angle-brackets when including user_settings.h. 2. Used angle-brackets rather than quotes when including the ThreadX and NetX headers. 3. Added a define flag to include types.h with NetX or ThreadX. 4. Added a void typecast to hush a warning about an unused variable in the I/O callbacks for NetX. 5. Clean up static analysis warning in the peer sequence number selection for DTLS. --- src/internal.c | 6 ++---- wolfssl/wolfcrypt/settings.h | 7 +++++-- wolfssl/wolfcrypt/wc_port.h | 5 ++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/internal.c b/src/internal.c index 7850eedf2..f8c76ac9e 100755 --- a/src/internal.c +++ b/src/internal.c @@ -9739,10 +9739,8 @@ static INLINE int DtlsUpdateWindow(WOLFSSL* ssl) cur_hi = ssl->keys.curSeq_hi; cur_lo = ssl->keys.curSeq_lo; - if (!ssl->options.haveMcast) - peerSeq = ssl->keys.peerSeq; - else { #ifdef WOLFSSL_MULTICAST + if (ssl->options.haveMcast) { WOLFSSL_DTLS_PEERSEQ* p; int i; @@ -9779,8 +9777,8 @@ static INLINE int DtlsUpdateWindow(WOLFSSL* ssl) ssl->ctx->mcastSecondSeq, ssl->ctx->mcastMaxSeq); } -#endif } +#endif if (ssl->keys.curEpoch == peerSeq->nextEpoch) { next_hi = &peerSeq->nextSeq_hi; diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 92bb3b2c0..58d1bd2c6 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -153,7 +153,7 @@ #include #ifdef WOLFSSL_USER_SETTINGS - #include + #include "user_settings.h" #endif @@ -174,7 +174,10 @@ #endif #ifdef HAVE_NETX - #include "nx_api.h" + #ifdef NEED_THREADX_TYPES + #include + #endif + #include #endif #if defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */ diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index 0c42240f0..d10522cbf 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -49,7 +49,10 @@ #endif #elif defined(THREADX) #ifndef SINGLE_THREADED - #include "tx_api.h" + #ifdef NEED_THREADX_TYPES + #include + #endif + #include #endif #elif defined(MICRIUM) /* do nothing, just don't pick Unix */