diff options
author | Xin Long | 2019-01-28 08:08:28 +0100 |
---|---|---|
committer | David S. Miller | 2019-01-30 09:44:06 +0100 |
commit | 48c072174dea73c4c36ba95df87c1b4d6083df11 (patch) | |
tree | f9a8904a91dfcf0f4c56bd5ef9eb4241d71dca5b /net/sctp/socket.c | |
parent | sctp: use SCTP_FUTURE_ASSOC for SCTP_MAXSEG sockopt (diff) | |
download | kernel-qcow2-linux-48c072174dea73c4c36ba95df87c1b4d6083df11.tar.gz kernel-qcow2-linux-48c072174dea73c4c36ba95df87c1b4d6083df11.tar.xz kernel-qcow2-linux-48c072174dea73c4c36ba95df87c1b4d6083df11.zip |
sctp: use SCTP_FUTURE_ASSOC for SCTP_LOCAL_AUTH_CHUNKS sockopt
Check with SCTP_FUTURE_ASSOC instead in
sctp_getsockopt_local_auth_chunks, it's compatible with 0.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index f38c9127e858..7df2123ae64c 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -6767,14 +6767,12 @@ static int sctp_getsockopt_local_auth_chunks(struct sock *sk, int len, to = p->gauth_chunks; asoc = sctp_id2assoc(sk, val.gauth_assoc_id); - if (!asoc && val.gauth_assoc_id && sctp_style(sk, UDP)) + if (!asoc && val.gauth_assoc_id != SCTP_FUTURE_ASSOC && + sctp_style(sk, UDP)) return -EINVAL; - if (asoc) - ch = (struct sctp_chunks_param *)asoc->c.auth_chunks; - else - ch = ep->auth_chunk_list; - + ch = asoc ? (struct sctp_chunks_param *)asoc->c.auth_chunks + : ep->auth_chunk_list; if (!ch) goto num; |