Skip to content

Commit

Permalink
sctp: use SCTP_FUTURE_ASSOC for SCTP_LOCAL_AUTH_CHUNKS sockopt
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xin Long authored and David S. Miller committed Jan 30, 2019
1 parent 6fd769b commit 48c0721
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 48c0721

Please sign in to comment.