aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-30 05:37:46 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-30 05:44:25 -0400
commit8d50b53d66a8a6ae41bafbdcabe401467803f33a (patch)
tree7a23efd740161b5b32d3fd473cf024e1a8931ce1 /net/core/dev.c
parent38c080ffa9c1b840390832b42ce8621464ab9f97 (diff)
pkt_sched: Fix OOPS on ingress qdisc add.
Bug report from Steven Jan Springl: Issuing the following command causes a kernel oops: tc qdisc add dev eth0 handle ffff: ingress The problem mostly stems from all of the special case handling of ingress qdiscs. So, to fix this, do the grafting operation the same way we do for TX qdiscs. Which means that dev_activate() and dev_deactivate() now do the "qdisc_sleeping <--> qdisc" transitions on dev->rx_queue too. Future simplifications are possible now, mainly because it is impossible for dev_queue->{qdisc,qdisc_sleeping} to be NULL. There are NULL checks all over to handle the ingress qdisc special case that used to exist before this commit. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 8d13a9b9f1df..63d6bcddbf46 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2100,7 +2100,7 @@ static int ing_filter(struct sk_buff *skb)
2100 rxq = &dev->rx_queue; 2100 rxq = &dev->rx_queue;
2101 2101
2102 q = rxq->qdisc; 2102 q = rxq->qdisc;
2103 if (q) { 2103 if (q != &noop_qdisc) {
2104 spin_lock(qdisc_lock(q)); 2104 spin_lock(qdisc_lock(q));
2105 result = qdisc_enqueue_root(skb, q); 2105 result = qdisc_enqueue_root(skb, q);
2106 spin_unlock(qdisc_lock(q)); 2106 spin_unlock(qdisc_lock(q));
@@ -2113,7 +2113,7 @@ static inline struct sk_buff *handle_ing(struct sk_buff *skb,
2113 struct packet_type **pt_prev, 2113 struct packet_type **pt_prev,
2114 int *ret, struct net_device *orig_dev) 2114 int *ret, struct net_device *orig_dev)
2115{ 2115{
2116 if (!skb->dev->rx_queue.qdisc) 2116 if (skb->dev->rx_queue.qdisc == &noop_qdisc)
2117 goto out; 2117 goto out;
2118 2118
2119 if (*pt_prev) { 2119 if (*pt_prev) {