Skip to content

Commit b44b56d

Browse files
committed
An attempt to fix usrsctp library build from git
1 parent 9eae9d5 commit b44b56d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

cmake/modules/IrisSCTP.cmake

+5
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ else()
6060
if(NOT Git_FOUND)
6161
message(FATAL_ERROR "Git not found! Bundled UsrSCTP needs Git utility.\nPlease set GIT_EXECUTABLE variable or add git to PATH")
6262
endif()
63+
set(patch_command
64+
${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/usrsctp.patch <SOURCE_DIR> &&
65+
${GIT_EXECUTABLE} checkout <SOURCE_DIR>/usrsctplib/netinet/sctp_output.c &&
66+
${GIT_EXECUTABLE} apply <SOURCE_DIR>/usrsctp.patch)
6367
ExternalProject_Add(UsrSCTPProject
6468
PREFIX ${USRSCTP_PREFIX}
6569
BINARY_DIR ${USRSCTP_BUILD_DIR}
@@ -68,6 +72,7 @@ else()
6872
CMAKE_ARGS ${USRSCTP_BUILD_OPTIONS}
6973
BUILD_BYPRODUCTS ${USRSCTP_LIBRARY}
7074
INSTALL_COMMAND ""
75+
PATCH_COMMAND ${patch_command}
7176
)
7277
endif()
7378
add_library(SctpLab::UsrSCTP UNKNOWN IMPORTED)

cmake/modules/usrsctp.patch

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
3+
diff --git a/usrsctplib/netinet/sctp_output.c b/usrsctplib/netinet/sctp_output.c
4+
index b8a7b46..6f9c9b9 100644
5+
--- a/usrsctplib/netinet/sctp_output.c
6+
+++ b/usrsctplib/netinet/sctp_output.c
7+
@@ -13562,10 +13562,10 @@ sctp_lower_sosend(struct socket *so,
8+
#endif
9+
struct timeval now;
10+
struct sctp_block_entry be;
11+
- struct sctp_inpcb *inp;
12+
+ struct sctp_inpcb *inp = NULL;
13+
struct sctp_tcb *stcb = NULL;
14+
struct sctp_nets *net;
15+
- struct sctp_association *asoc;
16+
+ struct sctp_association *asoc = NULL;
17+
struct sctp_inpcb *t_inp;
18+
struct sctp_nonpad_sndrcvinfo *sndrcvninfo;
19+
ssize_t sndlen = 0, max_len, local_add_more;

0 commit comments

Comments
 (0)