forked from wolfSSL/wolfssl
1. Needed to tell the client to use sctp.
2. Creating the example sockets needed the IPPROTO type.
This commit is contained in:
@ -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
|
||||
|
@ -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");
|
||||
|
Reference in New Issue
Block a user