Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74884
b: refs/heads/master
c: ef5d4cf
h: refs/heads/master
v: v3
  • Loading branch information
Vlad Yasevich authored and David S. Miller committed Dec 16, 2007
1 parent fba7208 commit d55e74c
Show file tree
Hide file tree
Showing 2 changed files with 34 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: 215f7b08f2a142ec19f4bd3d6de263e68b877955
refs/heads/master: ef5d4cf2f9aae4e09883d2d664e367a16b47d857
33 changes: 33 additions & 0 deletions trunk/net/sctp/ulpqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ static struct sctp_ulpevent * sctp_ulpq_reasm(struct sctp_ulpq *ulpq,
struct sctp_ulpevent *);
static struct sctp_ulpevent * sctp_ulpq_order(struct sctp_ulpq *,
struct sctp_ulpevent *);
static void sctp_ulpq_reasm_drain(struct sctp_ulpq *ulpq);

/* 1st Level Abstractions */

Expand Down Expand Up @@ -190,6 +191,7 @@ static void sctp_ulpq_set_pd(struct sctp_ulpq *ulpq)
static int sctp_ulpq_clear_pd(struct sctp_ulpq *ulpq)
{
ulpq->pd_mode = 0;
sctp_ulpq_reasm_drain(ulpq);
return sctp_clear_pd(ulpq->asoc->base.sk, ulpq->asoc);
}

Expand Down Expand Up @@ -699,6 +701,37 @@ void sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *ulpq, __u32 fwd_tsn)
}
}

/*
* Drain the reassembly queue. If we just cleared parted delivery, it
* is possible that the reassembly queue will contain already reassembled
* messages. Retrieve any such messages and give them to the user.
*/
static void sctp_ulpq_reasm_drain(struct sctp_ulpq *ulpq)
{
struct sctp_ulpevent *event = NULL;
struct sk_buff_head temp;

if (skb_queue_empty(&ulpq->reasm))
return;

while ((event = sctp_ulpq_retrieve_reassembled(ulpq)) != NULL) {
/* Do ordering if needed. */
if ((event) && (event->msg_flags & MSG_EOR)){
skb_queue_head_init(&temp);
__skb_queue_tail(&temp, sctp_event2skb(event));

event = sctp_ulpq_order(ulpq, event);
}

/* Send event to the ULP. 'event' is the
* sctp_ulpevent for very first SKB on the temp' list.
*/
if (event)
sctp_ulpq_tail_event(ulpq, event);
}
}


/* Helper function to gather skbs that have possibly become
* ordered by an an incoming chunk.
*/
Expand Down

0 comments on commit d55e74c

Please sign in to comment.