From aed68e1c691c687ee42ad3f4349d343f427b82a4 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 26 Aug 2016 10:47:01 -0700 Subject: [PATCH] 1. Needed to tell the client to use sctp. 2. Creating the example sockets needed the IPPROTO type. --- examples/client/client.c | 5 +++++ wolfssl/test.h | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/client/client.c b/examples/client/client.c index 67ae69cd8..ae61c1a5f 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -1131,6 +1131,11 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args) } } +#ifdef WOLFSSL_SCTP + if (dtlsSCTP) + wolfSSL_CTX_dtls_set_sctp(ctx); +#endif + #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) wolfSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); #endif diff --git a/wolfssl/test.h b/wolfssl/test.h index c0197d590..51be479e3 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -662,11 +662,11 @@ static INLINE void build_addr(SOCKADDR_IN_T* addr, const char* peer, static INLINE void tcp_socket(SOCKET_T* sockfd, int udp, int sctp) { if (udp) - *sockfd = socket(AF_INET_V, SOCK_DGRAM, 0); + *sockfd = socket(AF_INET_V, SOCK_DGRAM, IPPROTO_UDP); else if (sctp) - *sockfd = socket(AF_INET_V, SOCK_STREAM, 0); + *sockfd = socket(AF_INET_V, SOCK_STREAM, IPPROTO_SCTP); else - *sockfd = socket(AF_INET_V, SOCK_STREAM, 0); + *sockfd = socket(AF_INET_V, SOCK_STREAM, IPPROTO_TCP); if(WOLFSSL_SOCKET_IS_INVALID(*sockfd)) { err_sys("socket failed\n");