Skip to content

Commit

Permalink
An attempt to fix usrsctp library build from git
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitozz committed Apr 12, 2024
1 parent 9eae9d5 commit b44b56d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmake/modules/IrisSCTP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ else()
if(NOT Git_FOUND)
message(FATAL_ERROR "Git not found! Bundled UsrSCTP needs Git utility.\nPlease set GIT_EXECUTABLE variable or add git to PATH")
endif()
set(patch_command
${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/usrsctp.patch <SOURCE_DIR> &&
${GIT_EXECUTABLE} checkout <SOURCE_DIR>/usrsctplib/netinet/sctp_output.c &&
${GIT_EXECUTABLE} apply <SOURCE_DIR>/usrsctp.patch)
ExternalProject_Add(UsrSCTPProject
PREFIX ${USRSCTP_PREFIX}
BINARY_DIR ${USRSCTP_BUILD_DIR}
Expand All @@ -68,6 +72,7 @@ else()
CMAKE_ARGS ${USRSCTP_BUILD_OPTIONS}
BUILD_BYPRODUCTS ${USRSCTP_LIBRARY}
INSTALL_COMMAND ""
PATCH_COMMAND ${patch_command}
)
endif()
add_library(SctpLab::UsrSCTP UNKNOWN IMPORTED)
Expand Down
19 changes: 19 additions & 0 deletions cmake/modules/usrsctp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@


diff --git a/usrsctplib/netinet/sctp_output.c b/usrsctplib/netinet/sctp_output.c
index b8a7b46..6f9c9b9 100644
--- a/usrsctplib/netinet/sctp_output.c
+++ b/usrsctplib/netinet/sctp_output.c
@@ -13562,10 +13562,10 @@ sctp_lower_sosend(struct socket *so,
#endif
struct timeval now;
struct sctp_block_entry be;
- struct sctp_inpcb *inp;
+ struct sctp_inpcb *inp = NULL;
struct sctp_tcb *stcb = NULL;
struct sctp_nets *net;
- struct sctp_association *asoc;
+ struct sctp_association *asoc = NULL;
struct sctp_inpcb *t_inp;
struct sctp_nonpad_sndrcvinfo *sndrcvninfo;
ssize_t sndlen = 0, max_len, local_add_more;

0 comments on commit b44b56d

Please sign in to comment.