Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254690
b: refs/heads/master
c: 9491230
h: refs/heads/master
v: v3
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Jul 7, 2011
1 parent 17646f4 commit 17bb652
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f03d78db65085609938fdb686238867e65003181
refs/heads/master: 949123016a2ef578009b6aa3e98d45d1a154ebfb
23 changes: 23 additions & 0 deletions trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2073,10 +2073,33 @@ static int sctp_setsockopt_disable_fragments(struct sock *sk,
static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
unsigned int optlen)
{
struct sctp_association *asoc;
struct sctp_ulpevent *event;

if (optlen > sizeof(struct sctp_event_subscribe))
return -EINVAL;
if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen))
return -EFAULT;

/*
* At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT,
* if there is no data to be sent or retransmit, the stack will
* immediately send up this notification.
*/
if (sctp_ulpevent_type_enabled(SCTP_SENDER_DRY_EVENT,
&sctp_sk(sk)->subscribe)) {
asoc = sctp_id2assoc(sk, 0);

if (asoc && sctp_outq_is_empty(&asoc->outqueue)) {
event = sctp_ulpevent_make_sender_dry_event(asoc,
GFP_ATOMIC);
if (!event)
return -ENOMEM;

sctp_ulpq_tail_event(&asoc->ulpq, event);
}
}

return 0;
}

Expand Down

0 comments on commit 17bb652

Please sign in to comment.