1. Needed to tell the client to use sctp.

2. Creating the example sockets needed the IPPROTO type.
This commit is contained in:
John Safranek
2016-08-26 10:47:01 -07:00
parent 46e92e0211
commit aed68e1c69
2 changed files with 8 additions and 3 deletions

View File

@ -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) #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
wolfSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); wolfSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
#endif #endif

View File

@ -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) static INLINE void tcp_socket(SOCKET_T* sockfd, int udp, int sctp)
{ {
if (udp) if (udp)
*sockfd = socket(AF_INET_V, SOCK_DGRAM, 0); *sockfd = socket(AF_INET_V, SOCK_DGRAM, IPPROTO_UDP);
else if (sctp) else if (sctp)
*sockfd = socket(AF_INET_V, SOCK_STREAM, 0); *sockfd = socket(AF_INET_V, SOCK_STREAM, IPPROTO_SCTP);
else else
*sockfd = socket(AF_INET_V, SOCK_STREAM, 0); *sockfd = socket(AF_INET_V, SOCK_STREAM, IPPROTO_TCP);
if(WOLFSSL_SOCKET_IS_INVALID(*sockfd)) { if(WOLFSSL_SOCKET_IS_INVALID(*sockfd)) {
err_sys("socket failed\n"); err_sys("socket failed\n");