Skip to content

Commit

Permalink
Don't start SCTP/UDP receive threads (and don't open corresponding
Browse files Browse the repository at this point in the history
UDP sockets) when the UDP port specified in scpt_init() is 0.

This helps #532. Howver,
this removes the non-intended behaviour used in
#265.
  • Loading branch information
tuexen committed Oct 1, 2020
1 parent b8df6b5 commit f15553f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions usrsctplib/user_recv_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit f15553f

Please sign in to comment.