From 29cf90a425c2c0bf55542e452b45cca1a30f3c95 Mon Sep 17 00:00:00 2001 From: Chris Conlon Date: Tue, 4 Oct 2016 15:49:03 -0600 Subject: [PATCH] protect IPPROTO_SCTP with WOLFSSL_SCTP in test.h --- wolfssl/test.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wolfssl/test.h b/wolfssl/test.h index 51be479e3..b6833009e 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -632,10 +632,13 @@ static INLINE void build_addr(SOCKADDR_IN_T* addr, const char* peer, if (udp) { hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = IPPROTO_UDP; - } else if (sctp) { + } + #ifdef WOLFSSL_SCTP + else if (sctp) { hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_SCTP; } + #endif else { hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; @@ -663,8 +666,10 @@ static INLINE void tcp_socket(SOCKET_T* sockfd, int udp, int sctp) { if (udp) *sockfd = socket(AF_INET_V, SOCK_DGRAM, IPPROTO_UDP); +#ifdef WOLFSSL_SCTP else if (sctp) *sockfd = socket(AF_INET_V, SOCK_STREAM, IPPROTO_SCTP); +#endif else *sockfd = socket(AF_INET_V, SOCK_STREAM, IPPROTO_TCP);