diff --git a/usrsctplib/netinet/sctp_usrreq.c b/usrsctplib/netinet/sctp_usrreq.c index 5e5436048..278b8ab92 100755 --- a/usrsctplib/netinet/sctp_usrreq.c +++ b/usrsctplib/netinet/sctp_usrreq.c @@ -138,7 +138,7 @@ sctp_init(void) SCTP_BASE_VAR(timer_thread_started) = 0; #endif #if defined(__Userspace__) - sctp_pcb_init(start_threads); + sctp_pcb_init(start_threads == 1); if (start_threads) { sctp_start_timer_thread(); } diff --git a/usrsctplib/user_socket.c b/usrsctplib/user_socket.c index 7aeb7337e..18b837600 100755 --- a/usrsctplib/user_socket.c +++ b/usrsctplib/user_socket.c @@ -113,6 +113,16 @@ usrsctp_init(uint16_t port, } +void +usrsctp_init_noudpthread(uint16_t port, + int (*conn_output)(void *addr, void *buffer, size_t length, uint8_t tos, uint8_t set_df), + void (*debug_printf)(const char *format, ...)) +{ + init_sync(); + sctp_init(port, conn_output, debug_printf, 2); +} + + void usrsctp_init_nothreads(uint16_t port, int (*conn_output)(void *addr, void *buffer, size_t length, uint8_t tos, uint8_t set_df), diff --git a/usrsctplib/usrsctp.h b/usrsctplib/usrsctp.h index b7192904e..22f277887 100644 --- a/usrsctplib/usrsctp.h +++ b/usrsctplib/usrsctp.h @@ -895,6 +895,11 @@ usrsctp_init(uint16_t, int (*)(void *addr, void *buffer, size_t length, uint8_t tos, uint8_t set_df), void (*)(const char *format, ...)); +void +usrsctp_init_noudpthread(uint16_t, + int (*)(void *addr, void *buffer, size_t length, uint8_t tos, uint8_t set_df), + void (*)(const char *format, ...)); + void usrsctp_init_nothreads(uint16_t, int (*)(void *addr, void *buffer, size_t length, uint8_t tos, uint8_t set_df),