From: Asim Shankar Date: Tue, 3 May 2005 21:39:33 +0000 (-0700) Subject: [PKT_SCHED]: HTB: Drop packet when direct queue is full X-Git-Tag: v2.6.12-rc4~117^2~23^2~13 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=033d899904792d3501b7dd469495ca9138424ec3;p=linux-2.6 [PKT_SCHED]: HTB: Drop packet when direct queue is full htb_enqueue(): Free skb and return NET_XMIT_DROP if a packet is destined for the direct_queue but the direct_queue is full. (Before this: erroneously returned NET_XMIT_SUCCESS even though the packet was not enqueued) Signed-off-by: Asim Shankar Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index a85935e7d5..558cc087e6 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c @@ -717,6 +717,10 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch) if (q->direct_queue.qlen < q->direct_qlen) { __skb_queue_tail(&q->direct_queue, skb); q->direct_pkts++; + } else { + kfree_skb(skb); + sch->qstats.drops++; + return NET_XMIT_DROP; } #ifdef CONFIG_NET_CLS_ACT } else if (!cl) {