/* . Set or Get the default context (SCTP_CONTEXT) (chapter and verse is quoted at sctp_setsockopt_context())  */
static int sctp_getsockopt_context(struct sock *sk, int len, char __user *optval, int __user *optlen)
/* . Set or Get the default context (SCTP_CONTEXT) (chapter and verse is quoted at sctp_setsockopt_context())  */
static int sctp_getsockopt_context(struct sock *sk, int len, char __user *optval, int __user *optlen)
{
	struct sctp_assoc_value params;
	struct sctp_sock *sp;
	struct sctp_association *asoc;
	if (len < sizeof(struct sctp_assoc_value))
		return -EINVAL;
	len = sizeof(struct sctp_assoc_value);
	if (copy_from_user(&params, optval, len))
		return -EFAULT;
	sp = sctp_sk(sk);
	if (params.assoc_id != 0) {
		asoc = sctp_id2assoc(sk, params.assoc_id);
		if (!asoc)
			return -EINVAL;
		params.assoc_value = asoc->default_rcv_context;
	} else {
		params.assoc_value = sp->default_rcv_context;
	}
	if (put_user(len, optlen))
		return -EFAULT;
	if (copy_to_user(optval, &params, len))
		return -EFAULT;
	return 0;
}