Skip to content

Commit

Permalink
pkt_sched: Fix qdisc_graft WRT ingress qdisc
Browse files Browse the repository at this point in the history
After the recent mq change using ingress qdisc overwrites dev->qdisc;
there is also a wrong old qdisc pointer passed to notify_and_destroy.

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Sep 15, 2009
1 parent d314737 commit 036d6a6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,13 +693,18 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
if (new && i > 0)
atomic_inc(&new->refcnt);

qdisc_destroy(old);
if (!ingress)
qdisc_destroy(old);
}

notify_and_destroy(skb, n, classid, dev->qdisc, new);
if (new && !new->ops->attach)
atomic_inc(&new->refcnt);
dev->qdisc = new ? : &noop_qdisc;
if (!ingress) {
notify_and_destroy(skb, n, classid, dev->qdisc, new);
if (new && !new->ops->attach)
atomic_inc(&new->refcnt);
dev->qdisc = new ? : &noop_qdisc;
} else {
notify_and_destroy(skb, n, classid, old, new);
}

if (dev->flags & IFF_UP)
dev_activate(dev);
Expand Down

0 comments on commit 036d6a6

Please sign in to comment.