Skip to content

Commit 145cb2f

Browse files
JereLeppanendavem330
authored andcommitted
sctp: Fix bundling of SHUTDOWN with COOKIE-ACK
When we start shutdown in sctp_sf_do_dupcook_a(), we want to bundle the SHUTDOWN with the COOKIE-ACK to ensure that the peer receives them at the same time and in the correct order. This bundling was broken by commit 4ff40b8 ("sctp: set chunk transport correctly when it's a new asoc"), which assigns a transport for the COOKIE-ACK, but not for the SHUTDOWN. Fix this by passing a reference to the COOKIE-ACK chunk as an argument to sctp_sf_do_9_2_start_shutdown() and onward to sctp_make_shutdown(). This way the SHUTDOWN chunk is assigned the same transport as the COOKIE-ACK chunk, which allows them to be bundled. In sctp_sf_do_9_2_start_shutdown(), the void *arg parameter was previously unused. Now that we're taking it into use, it must be a valid pointer to a chunk, or NULL. There is only one call site where it's not, in sctp_sf_autoclose_timer_expire(). Fix that too. Fixes: 4ff40b8 ("sctp: set chunk transport correctly when it's a new asoc") Signed-off-by: Jere Leppänen <[email protected]> Acked-by: Marcelo Ricardo Leitner <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 72579e1 commit 145cb2f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/sctp/sm_statefuns.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,7 +1865,7 @@ static enum sctp_disposition sctp_sf_do_dupcook_a(
18651865
*/
18661866
sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
18671867
return sctp_sf_do_9_2_start_shutdown(net, ep, asoc,
1868-
SCTP_ST_CHUNK(0), NULL,
1868+
SCTP_ST_CHUNK(0), repl,
18691869
commands);
18701870
} else {
18711871
sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
@@ -5470,7 +5470,7 @@ enum sctp_disposition sctp_sf_do_9_2_start_shutdown(
54705470
* in the Cumulative TSN Ack field the last sequential TSN it
54715471
* has received from the peer.
54725472
*/
5473-
reply = sctp_make_shutdown(asoc, NULL);
5473+
reply = sctp_make_shutdown(asoc, arg);
54745474
if (!reply)
54755475
goto nomem;
54765476

@@ -6068,7 +6068,7 @@ enum sctp_disposition sctp_sf_autoclose_timer_expire(
60686068
disposition = SCTP_DISPOSITION_CONSUME;
60696069
if (sctp_outq_is_empty(&asoc->outqueue)) {
60706070
disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type,
6071-
arg, commands);
6071+
NULL, commands);
60726072
}
60736073

60746074
return disposition;

0 commit comments

Comments
 (0)