Loading net/sctp/socket.c +4 −9 Original line number Original line Diff line number Diff line Loading @@ -3487,24 +3487,19 @@ static int sctp_setsockopt_fragment_interleave(struct sock *sk, * call as long as the user provided buffer is large enough to hold the * call as long as the user provided buffer is large enough to hold the * message. * message. */ */ static int sctp_setsockopt_partial_delivery_point(struct sock *sk, static int sctp_setsockopt_partial_delivery_point(struct sock *sk, u32 *val, char __user *optval, unsigned int optlen) unsigned int optlen) { { u32 val; if (optlen != sizeof(u32)) if (optlen != sizeof(u32)) return -EINVAL; return -EINVAL; if (get_user(val, (int __user *)optval)) return -EFAULT; /* Note: We double the receive buffer from what the user sets /* Note: We double the receive buffer from what the user sets * it to be, also initial rwnd is based on rcvbuf/2. * it to be, also initial rwnd is based on rcvbuf/2. */ */ if (val > (sk->sk_rcvbuf >> 1)) if (*val > (sk->sk_rcvbuf >> 1)) return -EINVAL; return -EINVAL; sctp_sk(sk)->pd_point = val; sctp_sk(sk)->pd_point = *val; return 0; /* is this the right error code? */ return 0; /* is this the right error code? */ } } Loading Loading @@ -4695,7 +4690,7 @@ static int sctp_setsockopt(struct sock *sk, int level, int optname, retval = sctp_setsockopt_delayed_ack(sk, kopt, optlen); retval = sctp_setsockopt_delayed_ack(sk, kopt, optlen); break; break; case SCTP_PARTIAL_DELIVERY_POINT: case SCTP_PARTIAL_DELIVERY_POINT: retval = sctp_setsockopt_partial_delivery_point(sk, optval, optlen); retval = sctp_setsockopt_partial_delivery_point(sk, kopt, optlen); break; break; case SCTP_INITMSG: case SCTP_INITMSG: Loading Loading
net/sctp/socket.c +4 −9 Original line number Original line Diff line number Diff line Loading @@ -3487,24 +3487,19 @@ static int sctp_setsockopt_fragment_interleave(struct sock *sk, * call as long as the user provided buffer is large enough to hold the * call as long as the user provided buffer is large enough to hold the * message. * message. */ */ static int sctp_setsockopt_partial_delivery_point(struct sock *sk, static int sctp_setsockopt_partial_delivery_point(struct sock *sk, u32 *val, char __user *optval, unsigned int optlen) unsigned int optlen) { { u32 val; if (optlen != sizeof(u32)) if (optlen != sizeof(u32)) return -EINVAL; return -EINVAL; if (get_user(val, (int __user *)optval)) return -EFAULT; /* Note: We double the receive buffer from what the user sets /* Note: We double the receive buffer from what the user sets * it to be, also initial rwnd is based on rcvbuf/2. * it to be, also initial rwnd is based on rcvbuf/2. */ */ if (val > (sk->sk_rcvbuf >> 1)) if (*val > (sk->sk_rcvbuf >> 1)) return -EINVAL; return -EINVAL; sctp_sk(sk)->pd_point = val; sctp_sk(sk)->pd_point = *val; return 0; /* is this the right error code? */ return 0; /* is this the right error code? */ } } Loading Loading @@ -4695,7 +4690,7 @@ static int sctp_setsockopt(struct sock *sk, int level, int optname, retval = sctp_setsockopt_delayed_ack(sk, kopt, optlen); retval = sctp_setsockopt_delayed_ack(sk, kopt, optlen); break; break; case SCTP_PARTIAL_DELIVERY_POINT: case SCTP_PARTIAL_DELIVERY_POINT: retval = sctp_setsockopt_partial_delivery_point(sk, optval, optlen); retval = sctp_setsockopt_partial_delivery_point(sk, kopt, optlen); break; break; case SCTP_INITMSG: case SCTP_INITMSG: Loading