/* Turn on/off any Nagle-like algorithm. This means that packets are generally sent as soon as possible and no unnecessary delays are introduced, at the cost of more packets in the network. Expects an integer boolean flag.  */
static int sctp_setsockopt_nodelay(struct sock *sk, char __user *optval, unsigned int optlen)
/* Turn on/off any Nagle-like algorithm. This means that packets are generally sent as soon as possible and no unnecessary delays are introduced, at the cost of more packets in the network. Expects an integer boolean flag.  */
static int sctp_setsockopt_nodelay(struct sock *sk, char __user *optval, unsigned int optlen)
{
	int val;
	if (optlen < sizeof(int))
		return -EINVAL;
	if (get_user(val, (int __user *)optval))
		return -EFAULT;
	sctp_sk(sk)->nodelay = (val == 0) ? 0 : 1;
	return 0;
}