Skip to content

Commit 11d3c94

Browse files
committed
Merge branch 'sctp-dupcookie-fixes'
Xin Long says: ==================== sctp: a bunch of fixes for processing dupcookie After introducing transport hashtable and per stream info into sctp, some regressions were caused when processing dupcookie, this patchset is to fix them. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 12e8b57 + 7e06297 commit 11d3c94

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

net/sctp/associola.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,9 @@ void sctp_assoc_update(struct sctp_association *asoc,
11761176

11771177
asoc->ctsn_ack_point = asoc->next_tsn - 1;
11781178
asoc->adv_peer_ack_point = asoc->ctsn_ack_point;
1179-
if (!asoc->stream) {
1179+
1180+
if (sctp_state(asoc, COOKIE_WAIT)) {
1181+
sctp_stream_free(asoc->stream);
11801182
asoc->stream = new->stream;
11811183
new->stream = NULL;
11821184
}

net/sctp/sm_make_chunk.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,16 +2454,11 @@ int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk,
24542454
* stream sequence number shall be set to 0.
24552455
*/
24562456

2457-
/* Allocate storage for the negotiated streams if it is not a temporary
2458-
* association.
2459-
*/
2460-
if (!asoc->temp) {
2461-
if (sctp_stream_init(asoc, gfp))
2462-
goto clean_up;
2457+
if (sctp_stream_init(asoc, gfp))
2458+
goto clean_up;
24632459

2464-
if (sctp_assoc_set_id(asoc, gfp))
2465-
goto clean_up;
2466-
}
2460+
if (!asoc->temp && sctp_assoc_set_id(asoc, gfp))
2461+
goto clean_up;
24672462

24682463
/* ADDIP Section 4.1 ASCONF Chunk Procedures
24692464
*

net/sctp/sm_statefuns.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,6 +2088,9 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(struct net *net,
20882088
}
20892089
}
20902090

2091+
/* Set temp so that it won't be added into hashtable */
2092+
new_asoc->temp = 1;
2093+
20912094
/* Compare the tie_tag in cookie with the verification tag of
20922095
* current association.
20932096
*/

0 commit comments

Comments
 (0)