Advertisement
KukuRuzo

patch for iris

Apr 12th, 2024
1,035
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.91 KB | None | 0 0
  1. diff --git a/cmake/modules/usrsctp.patch b/cmake/modules/usrsctp.patch
  2. new file mode 100644
  3. index 0000000..25a6d23
  4. --- /dev/null
  5. +++ b/cmake/modules/usrsctp.patch
  6. @@ -0,0 +1,19 @@
  7. +
  8. +
  9. +diff --git a/usrsctplib/netinet/sctp_output.c b/usrsctplib/netinet/sctp_output.c
  10. +index b8a7b46..6f9c9b9 100644
  11. +--- a/usrsctplib/netinet/sctp_output.c
  12. ++++ b/usrsctplib/netinet/sctp_output.c
  13. +@@ -13562,10 +13562,10 @@ sctp_lower_sosend(struct socket *so,
  14. + #endif
  15. +   struct timeval now;
  16. +   struct sctp_block_entry be;
  17. +-  struct sctp_inpcb *inp;
  18. ++    struct sctp_inpcb *inp = NULL;
  19. +   struct sctp_tcb *stcb = NULL;
  20. +   struct sctp_nets *net;
  21. +-  struct sctp_association *asoc;
  22. ++    struct sctp_association *asoc = NULL;
  23. +   struct sctp_inpcb *t_inp;
  24. +   struct sctp_nonpad_sndrcvinfo *sndrcvninfo;
  25. +   ssize_t sndlen = 0, max_len, local_add_more;
  26. diff --git a/cmake/modules/IrisSCTP.cmake b/cmake/modules/IrisSCTP.cmake
  27. index 1bfa434..e6f1e18 100644
  28. --- a/cmake/modules/IrisSCTP.cmake
  29. +++ b/cmake/modules/IrisSCTP.cmake
  30. @@ -60,6 +60,10 @@ else()
  31.          if(NOT Git_FOUND)
  32.              message(FATAL_ERROR "Git not found! Bundled UsrSCTP needs Git utility.\nPlease set GIT_EXECUTABLE variable or add git to PATH")
  33.          endif()
  34. +        set(patch_command
  35. +        ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/usrsctp.patch <SOURCE_DIR> &&
  36. +        ${GIT_EXECUTABLE} checkout <SOURCE_DIR>/usrsctplib/netinet/sctp_output.c &&
  37. +        ${GIT_EXECUTABLE} apply <SOURCE_DIR>/usrsctp.patch)
  38.          ExternalProject_Add(UsrSCTPProject
  39.              PREFIX ${USRSCTP_PREFIX}
  40.              BINARY_DIR ${USRSCTP_BUILD_DIR}
  41. @@ -68,6 +72,7 @@ else()
  42.              CMAKE_ARGS ${USRSCTP_BUILD_OPTIONS}
  43.              BUILD_BYPRODUCTS ${USRSCTP_LIBRARY}
  44.              INSTALL_COMMAND ""
  45. +            PATCH_COMMAND ${patch_command}
  46.              )
  47.      endif()
  48.      add_library(SctpLab::UsrSCTP UNKNOWN IMPORTED)
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement