Skip to content

Commit 12dfd78

Browse files
JereLeppanendavem330
authored andcommitted
sctp: Fix SHUTDOWN CTSN Ack in the peer restart case
When starting shutdown in sctp_sf_do_dupcook_a(), get the value for SHUTDOWN Cumulative TSN Ack from the new association, which is reconstructed from the cookie, instead of the old association, which the peer doesn't have anymore. Otherwise the SHUTDOWN is either ignored or replied to with an ABORT by the peer because CTSN Ack doesn't match the peer's Initial TSN. Fixes: bdf6fa5 ("sctp: handle association restarts when the socket is closed.") 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 145cb2f commit 12dfd78

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/sctp/sm_make_chunk.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,11 @@ struct sctp_chunk *sctp_make_shutdown(const struct sctp_association *asoc,
858858
struct sctp_chunk *retval;
859859
__u32 ctsn;
860860

861-
ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
861+
if (chunk && chunk->asoc)
862+
ctsn = sctp_tsnmap_get_ctsn(&chunk->asoc->peer.tsn_map);
863+
else
864+
ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
865+
862866
shut.cum_tsn_ack = htonl(ctsn);
863867

864868
retval = sctp_make_control(asoc, SCTP_CID_SHUTDOWN, 0,

0 commit comments

Comments
 (0)