Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27593
b: refs/heads/master
c: d7c2c9e
h: refs/heads/master
i:
  27591: 331793a
v: v3
  • Loading branch information
Tsutomu Fujii authored and David S. Miller committed Jun 18, 2006
1 parent 72b625e commit 3cf7b74
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 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: 503b55fd77d11381b1950d1651d3bc782c0cc2cd
refs/heads/master: d7c2c9e3977e4312d093ac092761798d4d47c9e0
30 changes: 28 additions & 2 deletions trunk/net/sctp/ulpevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event,
struct sctp_association *asoc);
static void sctp_ulpevent_release_data(struct sctp_ulpevent *event);
static void sctp_ulpevent_release_frag_data(struct sctp_ulpevent *event);


/* Initialize an ULP event from an given skb. */
SCTP_STATIC void sctp_ulpevent_init(struct sctp_ulpevent *event, int msg_flags)
Expand Down Expand Up @@ -883,6 +885,7 @@ static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event,
static void sctp_ulpevent_release_data(struct sctp_ulpevent *event)
{
struct sk_buff *skb, *frag;
unsigned int len;

/* Current stack structures assume that the rcv buffer is
* per socket. For UDP style sockets this is not true as
Expand All @@ -892,7 +895,30 @@ static void sctp_ulpevent_release_data(struct sctp_ulpevent *event)
*/

skb = sctp_event2skb(event);
sctp_assoc_rwnd_increase(event->asoc, skb_headlen(skb));
len = skb->len;

if (!skb->data_len)
goto done;

/* Don't forget the fragments. */
for (frag = skb_shinfo(skb)->frag_list; frag; frag = frag->next) {
/* NOTE: skb_shinfos are recursive. Although IP returns
* skb's with only 1 level of fragments, SCTP reassembly can
* increase the levels.
*/
sctp_ulpevent_release_frag_data(sctp_skb2event(frag));
}

done:
sctp_assoc_rwnd_increase(event->asoc, len);
sctp_ulpevent_release_owner(event);
}

static void sctp_ulpevent_release_frag_data(struct sctp_ulpevent *event)
{
struct sk_buff *skb, *frag;

skb = sctp_event2skb(event);

if (!skb->data_len)
goto done;
Expand All @@ -903,7 +929,7 @@ static void sctp_ulpevent_release_data(struct sctp_ulpevent *event)
* skb's with only 1 level of fragments, SCTP reassembly can
* increase the levels.
*/
sctp_ulpevent_release_data(sctp_skb2event(frag));
sctp_ulpevent_release_frag_data(sctp_skb2event(frag));
}

done:
Expand Down

0 comments on commit 3cf7b74

Please sign in to comment.