Commit 036d6a673fa0a2e2c5b72a3b1d1b86114c1711c0

Authored by Jarek Poplawski
Committed by David S. Miller
1 parent d314737ad3

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>

Showing 1 changed file with 10 additions and 5 deletions Side-by-side Diff

... ... @@ -693,13 +693,18 @@
693 693 if (new && i > 0)
694 694 atomic_inc(&new->refcnt);
695 695  
696   - qdisc_destroy(old);
  696 + if (!ingress)
  697 + qdisc_destroy(old);
697 698 }
698 699  
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 + }
703 708  
704 709 if (dev->flags & IFF_UP)
705 710 dev_activate(dev);