sctp: fix ignoring asoc_id for tcp-style sockets on SCTP_ENABLE_STREAM_RESET sockopt

A similar fix as Patch "sctp: fix ignoring asoc_id for tcp-style sockets on
SCTP_DEFAULT_SEND_PARAM sockopt" on SCTP_ENABLE_STREAM_RESET sockopt.

Fixes: 99a62135e1 ("sctp: use SCTP_FUTURE_ASSOC and add SCTP_CURRENT_ASSOC for SCTP_ENABLE_STREAM_RESET sockopt")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Xin Long 2019-03-18 20:06:09 +08:00 committed by David S. Miller
parent cbb45c6cd5
commit 9430ff9926

View File

@ -4281,6 +4281,9 @@ static int sctp_setsockopt_enable_strreset(struct sock *sk,
goto out; goto out;
} }
if (sctp_style(sk, TCP))
params.assoc_id = SCTP_FUTURE_ASSOC;
if (params.assoc_id == SCTP_FUTURE_ASSOC || if (params.assoc_id == SCTP_FUTURE_ASSOC ||
params.assoc_id == SCTP_ALL_ASSOC) params.assoc_id == SCTP_ALL_ASSOC)
ep->strreset_enable = params.assoc_value; ep->strreset_enable = params.assoc_value;