aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 1a90530f83ff..7d5691cc1f47 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2724,22 +2724,25 @@ struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *d
2724{ 2724{
2725 struct sk_buff *next, *head = NULL, *tail; 2725 struct sk_buff *next, *head = NULL, *tail;
2726 2726
2727 while (skb) { 2727 for (; skb != NULL; skb = next) {
2728 next = skb->next; 2728 next = skb->next;
2729 skb->next = NULL; 2729 skb->next = NULL;
2730
2731 /* in case skb wont be segmented, point to itself */
2732 skb->prev = skb;
2733
2730 skb = validate_xmit_skb(skb, dev); 2734 skb = validate_xmit_skb(skb, dev);
2731 if (skb) { 2735 if (!skb)
2732 struct sk_buff *end = skb; 2736 continue;
2733 2737
2734 while (end->next) 2738 if (!head)
2735 end = end->next; 2739 head = skb;
2736 if (!head) 2740 else
2737 head = skb; 2741 tail->next = skb;
2738 else 2742 /* If skb was segmented, skb->prev points to
2739 tail->next = skb; 2743 * the last segment. If not, it still contains skb.
2740 tail = end; 2744 */
2741 } 2745 tail = skb->prev;
2742 skb = next;
2743 } 2746 }
2744 return head; 2747 return head;
2745} 2748}