Skip to content

Commit 036d6a6

Browse files
Jarek Poplawskidavem330
authored andcommitted
pkt_sched: Fix qdisc_graft WRT ingress qdisc
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>
1 parent d314737 commit 036d6a6

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

net/sched/sch_api.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -693,13 +693,18 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
693693
if (new && i > 0)
694694
atomic_inc(&new->refcnt);
695695

696-
qdisc_destroy(old);
696+
if (!ingress)
697+
qdisc_destroy(old);
697698
}
698699

699-
notify_and_destroy(skb, n, classid, dev->qdisc, new);
700-
if (new && !new->ops->attach)
701-
atomic_inc(&new->refcnt);
702-
dev->qdisc = new ? : &noop_qdisc;
700+
if (!ingress) {
701+
notify_and_destroy(skb, n, classid, dev->qdisc, new);
702+
if (new && !new->ops->attach)
703+
atomic_inc(&new->refcnt);
704+
dev->qdisc = new ? : &noop_qdisc;
705+
} else {
706+
notify_and_destroy(skb, n, classid, old, new);
707+
}
703708

704709
if (dev->flags & IFF_UP)
705710
dev_activate(dev);

0 commit comments

Comments
 (0)