Skip to content

Commit

Permalink
Cherry-pick usrsctp 355fb576b1a9dfef70fc0e158d66692662baaddc
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=219937

Reviewed by Alex Christensen.

* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c:
(sctp_process_cookie_existing):


Canonical link: https://commits.webkit.org/232531@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
youennf committed Dec 16, 2020
1 parent 4b9773f commit ea6c682
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Source/ThirdParty/libwebrtc/ChangeLog
@@ -1,3 +1,13 @@
2020-12-16 Youenn Fablet <youenn@apple.com>

Cherry-pick usrsctp 355fb576b1a9dfef70fc0e158d66692662baaddc
https://bugs.webkit.org/show_bug.cgi?id=219937

Reviewed by Alex Christensen.

* Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c:
(sctp_process_cookie_existing):

2020-12-16 Youenn Fablet <youenn@apple.com>

Cherry-pick usrsctp 7dab23aa0d8db86fedd222a308067439b03fad0f
Expand Down
Expand Up @@ -1594,6 +1594,11 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset,
{
struct sctp_association *asoc;
struct sctp_init_chunk *init_cp, init_buf;
struct sctp_asconf_addr *aparam, *naparam;
struct sctp_asconf_ack *aack, *naack;
struct sctp_tmit_chunk *chk, *nchk;
struct sctp_stream_reset_list *strrst, *nstrrst;
struct sctp_queued_to_read *sq, *nsq;
struct sctp_init_ack_chunk *initack_cp, initack_buf;
struct sctp_nets *net;
struct mbuf *op_err;
Expand Down Expand Up @@ -1893,7 +1898,6 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset,
* kick us so it COULD still take a timeout
* to move these.. but it can't hurt to mark them.
*/
struct sctp_tmit_chunk *chk;
TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) {
if (chk->sent < SCTP_DATAGRAM_RESEND) {
chk->sent = SCTP_DATAGRAM_RESEND;
Expand Down Expand Up @@ -2087,6 +2091,58 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset,
stcb->asoc.strmout[i].next_mid_unordered = 0;
stcb->asoc.strmout[i].last_msg_incomplete = 0;
}

TAILQ_FOREACH_SAFE(strrst, &asoc->resetHead, next_resp, nstrrst) {
TAILQ_REMOVE(&asoc->resetHead, strrst, next_resp);
SCTP_FREE(strrst, SCTP_M_STRESET);
}
TAILQ_FOREACH_SAFE(sq, &asoc->pending_reply_queue, next, nsq) {
TAILQ_REMOVE(&asoc->pending_reply_queue, sq, next);
if (sq->data) {
sctp_m_freem(sq->data);
sq->data = NULL;
}
sctp_free_remote_addr(sq->whoFrom);
sq->whoFrom = NULL;
sq->stcb = NULL;
sctp_free_a_readq(stcb, sq);
}
TAILQ_FOREACH_SAFE(chk, &asoc->control_send_queue, sctp_next, nchk) {
TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next);
if (chk->data) {
sctp_m_freem(chk->data);
chk->data = NULL;
}
if (chk->holds_key_ref)
sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED);
sctp_free_remote_addr(chk->whoTo);
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk);
SCTP_DECR_CHK_COUNT();
}
TAILQ_FOREACH_SAFE(chk, &asoc->asconf_send_queue, sctp_next, nchk) {
TAILQ_REMOVE(&asoc->asconf_send_queue, chk, sctp_next);
if (chk->data) {
sctp_m_freem(chk->data);
chk->data = NULL;
}
if (chk->holds_key_ref)
sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED);
sctp_free_remote_addr(chk->whoTo);
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk);
SCTP_DECR_CHK_COUNT();
}
TAILQ_FOREACH_SAFE(aparam, &asoc->asconf_queue, next, naparam) {
TAILQ_REMOVE(&asoc->asconf_queue, aparam, next);
SCTP_FREE(aparam,SCTP_M_ASC_ADDR);
}
TAILQ_FOREACH_SAFE(aack, &asoc->asconf_ack_sent, next, naack) {
TAILQ_REMOVE(&asoc->asconf_ack_sent, aack, next);
if (aack->data != NULL) {
sctp_m_freem(aack->data);
}
SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_asconf_ack), aack);
}

/* process the INIT-ACK info (my info) */
asoc->my_vtag = ntohl(initack_cp->init.initiate_tag);
asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd);
Expand Down

0 comments on commit ea6c682

Please sign in to comment.