Skip to content

Commit

Permalink
Revert "handle sctp shutdown issue mentioned here: sctplab/usrsctp#147"
Browse files Browse the repository at this point in the history
This reverts commit 4e13ff8.
  • Loading branch information
chehefen authored and niyatim23 committed Aug 19, 2021
1 parent 00e00b2 commit 13084d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ matrix:
# Old Version GCC 4.4
- name: "Linux GCC 4.4 Build"
os: linux
before_install:
# TODO: Remove the following line. This is only a workaround for enabling IPv6, https://github.com/travis-ci/travis-ci/issues/8891.
- sudo sh -c 'echo 0 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo apt-get -q update
- sudo apt-get -y install gcc-4.4
- sudo apt-get -y install gdb
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.4
- gdb
compiler: gcc
before_script: export CC=gcc-4.4 && mkdir build && cd build && cmake .. -DBUILD_TEST=TRUE

Expand Down
9 changes: 0 additions & 9 deletions src/source/Sctp/Sctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ STATUS createSctpSession(PSctpSessionCallbacks pSctpSessionCallbacks, PSctpSessi
MEMSET(&localConn, 0x00, SIZEOF(struct sockaddr_conn));
MEMSET(&remoteConn, 0x00, SIZEOF(struct sockaddr_conn));

ATOMIC_STORE(&pSctpSession->shutdownStatus, SCTP_SESSION_ACTIVE);
pSctpSession->sctpSessionCallbacks = *pSctpSessionCallbacks;

CHK_STATUS(initSctpAddrConn(pSctpSession, &localConn));
Expand Down Expand Up @@ -131,19 +130,13 @@ STATUS freeSctpSession(PSctpSession* ppSctpSession)
ENTERS();
STATUS retStatus = STATUS_SUCCESS;
PSctpSession pSctpSession;
UINT64 shutdownTimeout;

CHK(ppSctpSession != NULL, STATUS_NULL_ARG);

pSctpSession = *ppSctpSession;

CHK(pSctpSession != NULL, retStatus);

usrsctp_deregister_address(pSctpSession);
/* handle issue mentioned here: https://github.com/sctplab/usrsctp/issues/147
* the change in shutdownStatus will trigger onSctpOutboundPacket to return -1 */
ATOMIC_STORE(&pSctpSession->shutdownStatus, SCTP_SESSION_SHUTDOWN_INITIATED);

if (pSctpSession->socket != NULL) {
usrsctp_set_ulpinfo(pSctpSession->socket, NULL);
usrsctp_shutdown(pSctpSession->socket, SHUT_RDWR);
Expand Down Expand Up @@ -284,8 +277,6 @@ INT32 onSctpOutboundPacket(PVOID addr, PVOID data, ULONG length, UINT8 tos, UINT
return -1;
}

pSctpSession->sctpSessionCallbacks.outboundPacketFunc(pSctpSession->sctpSessionCallbacks.customData, data, length);

return 0;
}

Expand Down

0 comments on commit 13084d0

Please sign in to comment.