Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236669
b: refs/heads/master
c: 212bfb9
h: refs/heads/master
i:
  236667: 10b9a45
v: v3
  • Loading branch information
David S. Miller committed Jan 21, 2011
1 parent 88b41ae commit 0ec8625
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 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: b48f8c23c336d82c1af9a53187568bdb6e86b8a8
refs/heads/master: 212bfb9e94e86b40684076f642b089b0565455d2
39 changes: 23 additions & 16 deletions trunk/drivers/net/ppp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2055,16 +2055,6 @@ ppp_mp_reconstruct(struct ppp *ppp)
netdev_printk(KERN_DEBUG, ppp->dev,
"PPP: reconstructed packet"
" is too long (%d)\n", len);
} else if (p == head) {
/* fragment is complete packet - reuse skb */
tail = p;
skb = skb_get(p);
break;
} else if ((skb = dev_alloc_skb(len)) == NULL) {
++ppp->dev->stats.rx_missed_errors;
netdev_printk(KERN_DEBUG, ppp->dev,
"PPP: no memory for "
"reconstructed packet");
} else {
tail = p;
break;
Expand Down Expand Up @@ -2097,16 +2087,33 @@ ppp_mp_reconstruct(struct ppp *ppp)
ppp_receive_error(ppp);
}

if (head != tail)
/* copy to a single skb */
for (p = head; p != tail->next; p = p->next)
skb_copy_bits(p, 0, skb_put(skb, p->len), p->len);
skb = head;
if (head != tail) {
struct sk_buff **fragpp = &skb_shinfo(skb)->frag_list;
p = skb_queue_next(list, head);
__skb_unlink(skb, list);
skb_queue_walk_from_safe(list, p, tmp) {
__skb_unlink(p, list);
*fragpp = p;
p->next = NULL;
fragpp = &p->next;

skb->len += p->len;
skb->data_len += p->len;
skb->truesize += p->len;

if (p == tail)
break;
}
} else {
__skb_unlink(skb, list);
}

ppp->nextseq = PPP_MP_CB(tail)->sequence + 1;
head = tail->next;
}

/* Discard all the skbuffs that we have copied the data out of
or that we can't use. */
/* Discard all the skbuffs that we can't use. */
while ((p = list->next) != head) {
__skb_unlink(p, list);
kfree_skb(p);
Expand Down

0 comments on commit 0ec8625

Please sign in to comment.