/* This set option adds a chunk type that the user is requesting to be received only in an authenticated way. Changes to the list of chunks will only effect future associations on the socket.  */
static int sctp_setsockopt_auth_chunk(struct sock *sk, char __user *optval, unsigned int optlen)
/* This set option adds a chunk type that the user is requesting to be received only in an authenticated way. Changes to the list of chunks will only effect future associations on the socket.  */
static int sctp_setsockopt_auth_chunk(struct sock *sk, char __user *optval, unsigned int optlen)
{
	struct sctp_authchunk val;
	if (!sctp_auth_enable)
		return -EACCES;
	if (optlen != sizeof(struct sctp_authchunk))
		return -EINVAL;
	if (copy_from_user(&val, optval, optlen))
		return -EFAULT;
	switch (val.sauth_chunk) {
		case SCTP_CID_INIT:
		case SCTP_CID_INIT_ACK:
		case SCTP_CID_SHUTDOWN_COMPLETE:
		case SCTP_CID_AUTH:
			return -EINVAL;
	}
	return sctp_auth_ep_add_chunkid(sctp_sk(sk)->ep, val.sauth_chunk);
}