From f15553ff9eefe449ac0925a09a97af4b166d0f9b Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Thu, 1 Oct 2020 13:35:18 +0200 Subject: [PATCH] Don't start SCTP/UDP receive threads (and don't open corresponding UDP sockets) when the UDP port specified in scpt_init() is 0. This helps https://github.com/sctplab/usrsctp/pull/532. Howver, this removes the non-intended behaviour used in https://github.com/sctplab/usrsctp/issues/265. --- usrsctplib/user_recv_thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usrsctplib/user_recv_thread.c b/usrsctplib/user_recv_thread.c index 07cc21ac9..bb436cd20 100755 --- a/usrsctplib/user_recv_thread.c +++ b/usrsctplib/user_recv_thread.c @@ -1200,7 +1200,7 @@ recv_thread_init(void) } } } - if (SCTP_BASE_VAR(userspace_udpsctp) == -1) { + if ((SCTP_BASE_VAR(userspace_udpsctp) == -1) && (SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) != 0)) { if ((SCTP_BASE_VAR(userspace_udpsctp) = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { #if defined(_WIN32) SCTPDBG(SCTP_DEBUG_USR, "Can't create socket for SCTP/UDP/IPv4 (errno = %d).\n", WSAGetLastError()); @@ -1337,7 +1337,7 @@ recv_thread_init(void) } } } - if (SCTP_BASE_VAR(userspace_udpsctp6) == -1) { + if ((SCTP_BASE_VAR(userspace_udpsctp6) == -1) && (SCTP_BASE_SYSCTL(sctp_udp_tunneling_port) != 0)) { if ((SCTP_BASE_VAR(userspace_udpsctp6) = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP)) == -1) { #if defined(_WIN32) SCTPDBG(SCTP_DEBUG_USR, "Can't create socket for SCTP/UDP/IPv6 (errno = %d).\n", WSAGetLastError());