/* Handling for system calls applied via the various interfaces to a X.25 socket object.  */
static int x25_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen)
/* Handling for system calls applied via the various interfaces to a X.25 socket object.  */
static int x25_setsockopt(struct socket *sock, int level, int optname, char __user *optval, unsigned int optlen)
{
	int opt;
	struct sock *sk = sock->sk;
	int rc = -ENOPROTOOPT;
	lock_kernel();
	if (level != SOL_X25 || optname != X25_QBITINCL)
		goto out;
	rc = -EINVAL;
	if (optlen < sizeof(int))
		goto out;
	rc = -EFAULT;
	if (get_user(opt, (int __user *)optval))
		goto out;
	x25_sk(sk)->qbitincl = !!opt;
	rc = 0;
out:
	unlock_kernel();
	return rc;
}