Skip to content

Commit 356b23c

Browse files
qdkevinkoudavem330
authored andcommitted
sctp: do trace_sctp_probe after SACK validation and check
The function sctp_sf_eat_sack_6_2 now performs the Verification Tag validation, Chunk length validation, Bogu check, and also the detection of out-of-order SACK based on the RFC2960 Section 6.2 at the beginning, and finally performs the further processing of SACK. The trace_sctp_probe now triggered before the above necessary validation and check. this patch is to do the trace_sctp_probe after the chunk sanity tests, but keep doing trace if the SACK received is out of order, for the out-of-order SACK is valuable to congestion control debugging. v1->v2: - keep doing SCTP trace if the SACK is out of order as Marcelo's suggestion. v2->v3: - regenerate the patch as v2 generated on top of v1, and add 'net-next' tag to the new one as Marcelo's comments. Signed-off-by: Kevin Kou <[email protected]> Acked-by: Marcelo Ricardo Leitner <[email protected]> Acked-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0df9528 commit 356b23c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

net/sctp/sm_statefuns.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3281,8 +3281,6 @@ enum sctp_disposition sctp_sf_eat_sack_6_2(struct net *net,
32813281
struct sctp_sackhdr *sackh;
32823282
__u32 ctsn;
32833283

3284-
trace_sctp_probe(ep, asoc, chunk);
3285-
32863284
if (!sctp_vtag_verify(chunk, asoc))
32873285
return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
32883286

@@ -3299,6 +3297,15 @@ enum sctp_disposition sctp_sf_eat_sack_6_2(struct net *net,
32993297
chunk->subh.sack_hdr = sackh;
33003298
ctsn = ntohl(sackh->cum_tsn_ack);
33013299

3300+
/* If Cumulative TSN Ack beyond the max tsn currently
3301+
* send, terminating the association and respond to the
3302+
* sender with an ABORT.
3303+
*/
3304+
if (TSN_lte(asoc->next_tsn, ctsn))
3305+
return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands);
3306+
3307+
trace_sctp_probe(ep, asoc, chunk);
3308+
33023309
/* i) If Cumulative TSN Ack is less than the Cumulative TSN
33033310
* Ack Point, then drop the SACK. Since Cumulative TSN
33043311
* Ack is monotonically increasing, a SACK whose
@@ -3312,13 +3319,6 @@ enum sctp_disposition sctp_sf_eat_sack_6_2(struct net *net,
33123319
return SCTP_DISPOSITION_DISCARD;
33133320
}
33143321

3315-
/* If Cumulative TSN Ack beyond the max tsn currently
3316-
* send, terminating the association and respond to the
3317-
* sender with an ABORT.
3318-
*/
3319-
if (!TSN_lt(ctsn, asoc->next_tsn))
3320-
return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands);
3321-
33223322
/* Return this SACK for further processing. */
33233323
sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_SACK, SCTP_CHUNK(chunk));
33243324

0 commit comments

Comments
 (0)