Skip to contentSkip to conversation

: Fix bug in skb list splicing.

PATCH New David Miller 1 participant 1 message Sep 23, 2008

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 1/1 : Fix bug in skb list splicing.

We don't update the qlen correctly when 'head' is
non-empty.

net: Fix bus in SKB queue splicing interfaces.

Handle the case of head being non-empty, by adding list->qlen to head->qlen instead of using direct assignment.

---
 include/linux/skbuff.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
include/linux/skbuff.h +4 -4
index 027b061..4a144e8 100644
@@ -738,7 +738,7 @@ static inline void skb_queue_splice(const struct sk_buff_head *list,
 {
 	if (!skb_queue_empty(list)) {
 		__skb_queue_splice(list, (struct sk_buff *) head, head->next);
-		head->qlen = list->qlen;
+		head->qlen += list->qlen;
 	}
 }
 
@@ -754,7 +754,7 @@ static inline void skb_queue_splice_init(struct sk_buff_head *list,
 {
 	if (!skb_queue_empty(list)) {
 		__skb_queue_splice(list, (struct sk_buff *) head, head->next);
-		head->qlen = list->qlen;
+		head->qlen += list->qlen;
 		__skb_queue_head_init(list);
 	}
 }
@@ -769,7 +769,7 @@ static inline void skb_queue_splice_tail(const struct sk_buff_head *list,
 {
 	if (!skb_queue_empty(list)) {
 		__skb_queue_splice(list, head->prev, (struct sk_buff *) head);
-		head->qlen = list->qlen;
+		head->qlen += list->qlen;
 	}
 }
 
@@ -786,7 +786,7 @@ static inline void skb_queue_splice_tail_init(struct sk_buff_head *list,
 {
 	if (!skb_queue_empty(list)) {
 		__skb_queue_splice(list, head->prev, (struct sk_buff *) head);
-		head->qlen = list->qlen;
+		head->qlen += list->qlen;
 		__skb_queue_head_init(list);
 	}
 }
Signature · 1 line
1.5.6.5