aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/sch_generic.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 9dcb5bfe094a..64ae1ba9f554 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -442,8 +442,12 @@ static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch)
442static inline struct sk_buff *qdisc_peek_dequeued(struct Qdisc *sch) 442static inline struct sk_buff *qdisc_peek_dequeued(struct Qdisc *sch)
443{ 443{
444 /* we can reuse ->gso_skb because peek isn't called for root qdiscs */ 444 /* we can reuse ->gso_skb because peek isn't called for root qdiscs */
445 if (!sch->gso_skb) 445 if (!sch->gso_skb) {
446 sch->gso_skb = sch->dequeue(sch); 446 sch->gso_skb = sch->dequeue(sch);
447 if (sch->gso_skb)
448 /* it's still part of the queue */
449 sch->q.qlen++;
450 }
447 451
448 return sch->gso_skb; 452 return sch->gso_skb;
449} 453}
@@ -453,10 +457,12 @@ static inline struct sk_buff *qdisc_dequeue_peeked(struct Qdisc *sch)
453{ 457{
454 struct sk_buff *skb = sch->gso_skb; 458 struct sk_buff *skb = sch->gso_skb;
455 459
456 if (skb) 460 if (skb) {
457 sch->gso_skb = NULL; 461 sch->gso_skb = NULL;
458 else 462 sch->q.qlen--;
463 } else {
459 skb = sch->dequeue(sch); 464 skb = sch->dequeue(sch);
465 }
460 466
461 return skb; 467 return skb;
462} 468}