summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2019-03-18 20:06:04 +0800
committerDavid S. Miller <davem@davemloft.net>2019-03-18 18:31:09 -0700
commit0685d6b72207a6de7ea6853e48b009e71d64fe1b (patch)
treed7df70de730f8bb8dcaf60ca0c0fc53fc9b48757 /net
parent746bc215a6b223caf7eb6b33400458c15e742920 (diff)
downloadlinux-rpi-0685d6b72207a6de7ea6853e48b009e71d64fe1b.tar.gz
linux-rpi-0685d6b72207a6de7ea6853e48b009e71d64fe1b.tar.bz2
linux-rpi-0685d6b72207a6de7ea6853e48b009e71d64fe1b.zip
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>
Diffstat (limited to 'net')
-rw-r--r--net/sctp/socket.c3
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);