diff options
author | Xin Long <lucien.xin@gmail.com> | 2019-03-18 15:06:04 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-03-19 04:31:09 +0300 |
commit | 0685d6b72207a6de7ea6853e48b009e71d64fe1b (patch) | |
tree | d7df70de730f8bb8dcaf60ca0c0fc53fc9b48757 | |
parent | 746bc215a6b223caf7eb6b33400458c15e742920 (diff) | |
download | linux-0685d6b72207a6de7ea6853e48b009e71d64fe1b.tar.xz |
sctp: fix ignoring asoc_id for tcp-style sockets on SCTP_AUTH_KEY sockopt
A similar fix as Patch "sctp: fix ignoring asoc_id for tcp-style sockets on
SCTP_DEFAULT_SEND_PARAM sockopt" on SCTP_AUTH_KEY sockopt.
Fixes: 7fb3be13a236 ("sctp: use SCTP_FUTURE_ASSOC and add SCTP_CURRENT_ASSOC for SCTP_AUTH_KEY sockopt")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sctp/socket.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index df879b163414..2ac221c795c2 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -3813,6 +3813,9 @@ static int sctp_setsockopt_auth_key(struct sock *sk, goto out; } + if (sctp_style(sk, TCP)) + authkey->sca_assoc_id = SCTP_FUTURE_ASSOC; + if (authkey->sca_assoc_id == SCTP_FUTURE_ASSOC || authkey->sca_assoc_id == SCTP_ALL_ASSOC) { ret = sctp_auth_set_key(ep, asoc, authkey); |