Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26524
b: refs/heads/master
c: 672e7cc
h: refs/heads/master
v: v3
  • Loading branch information
Vladislav Yasevich authored and David S. Miller committed May 6, 2006
1 parent c2180e1 commit 16bc4a7
Show file tree
Hide file tree
Showing 2 changed files with 26 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: 7c3ceb4fb9667f34f1599a062efecf4cdc4a4ce5
refs/heads/master: 672e7cca17ed6036a1756ed34cf20dbd72d5e5f6
27 changes: 25 additions & 2 deletions trunk/net/sctp/ulpqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ static inline void sctp_ulpq_store_reasm(struct sctp_ulpq *ulpq,
static struct sctp_ulpevent *sctp_make_reassembled_event(struct sk_buff_head *queue, struct sk_buff *f_frag, struct sk_buff *l_frag)
{
struct sk_buff *pos;
struct sk_buff *new = NULL;
struct sctp_ulpevent *event;
struct sk_buff *pnext, *last;
struct sk_buff *list = skb_shinfo(f_frag)->frag_list;
Expand All @@ -297,11 +298,33 @@ static struct sctp_ulpevent *sctp_make_reassembled_event(struct sk_buff_head *qu
*/
if (last)
last->next = pos;
else
skb_shinfo(f_frag)->frag_list = pos;
else {
if (skb_cloned(f_frag)) {
/* This is a cloned skb, we can't just modify
* the frag_list. We need a new skb to do that.
* Instead of calling skb_unshare(), we'll do it
* ourselves since we need to delay the free.
*/
new = skb_copy(f_frag, GFP_ATOMIC);
if (!new)
return NULL; /* try again later */

new->sk = f_frag->sk;

skb_shinfo(new)->frag_list = pos;
} else
skb_shinfo(f_frag)->frag_list = pos;
}

/* Remove the first fragment from the reassembly queue. */
__skb_unlink(f_frag, queue);

/* if we did unshare, then free the old skb and re-assign */
if (new) {
kfree_skb(f_frag);
f_frag = new;
}

while (pos) {

pnext = pos->next;
Expand Down

0 comments on commit 16bc4a7

Please sign in to comment.