Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122866
b: refs/heads/master
c: 8510b93
h: refs/heads/master
v: v3
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Dec 26, 2008
1 parent 15c9366 commit 860363a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9fcb95a105758b81ef0131cd18e2db5149f13e95
refs/heads/master: 8510b937ae1e23583abdeb828cad5c518295c61d
19 changes: 16 additions & 3 deletions trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -3010,14 +3010,21 @@ static int sctp_setsockopt_fragment_interleave(struct sock *sk,
}

/*
* 7.1.25. Set or Get the sctp partial delivery point
* 8.1.21. Set or Get the SCTP Partial Delivery Point
* (SCTP_PARTIAL_DELIVERY_POINT)
*
* This option will set or get the SCTP partial delivery point. This
* point is the size of a message where the partial delivery API will be
* invoked to help free up rwnd space for the peer. Setting this to a
* lower value will cause partial delivery's to happen more often. The
* lower value will cause partial deliveries to happen more often. The
* calls argument is an integer that sets or gets the partial delivery
* point.
* point. Note also that the call will fail if the user attempts to set
* this value larger than the socket receive buffer size.
*
* Note that any single message having a length smaller than or equal to
* the SCTP partial delivery point will be delivered in one single read
* call as long as the user provided buffer is large enough to hold the
* message.
*/
static int sctp_setsockopt_partial_delivery_point(struct sock *sk,
char __user *optval,
Expand All @@ -3030,6 +3037,12 @@ static int sctp_setsockopt_partial_delivery_point(struct sock *sk,
if (get_user(val, (int __user *)optval))
return -EFAULT;

/* Note: We double the receive buffer from what the user sets
* it to be, also initial rwnd is based on rcvbuf/2.
*/
if (val > (sk->sk_rcvbuf >> 1))
return -EINVAL;

sctp_sk(sk)->pd_point = val;

return 0; /* is this the right error code? */
Expand Down

0 comments on commit 860363a

Please sign in to comment.