diff options
author | Eric Dumazet <edumazet@google.com> | 2013-12-12 15:41:56 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-14 01:20:06 -0500 |
commit | e57a784d8cae429f5b697fe55abf420181d9ff09 (patch) | |
tree | 69c247ac88bc588611f280bf684ae0a707523c63 /net/sched/sch_generic.c | |
parent | 59bcaed5f71f002d39d151ccd387dd0f226e00f2 (diff) |
pkt_sched: set root qdisc before change() in attach_default_qdiscs()
After commit 95dc19299f74 ("pkt_sched: give visibility to mq slave
qdiscs") we call disc_list_add() while the device qdisc might be
the noop_qdisc one.
This shows up as duplicates in "tc qdisc show", as all inactive devices
point to noop_qdisc.
Fix this by setting dev->qdisc to the new qdisc before calling
ops->change() in attach_default_qdiscs()
Add a WARN_ON_ONCE() to catch any future similar problem.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_generic.c')
-rw-r--r-- | net/sched/sch_generic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 6a91d7d48ad..32bb942d2fa 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -718,8 +718,8 @@ static void attach_default_qdiscs(struct net_device *dev) } else { qdisc = qdisc_create_dflt(txq, &mq_qdisc_ops, TC_H_ROOT); if (qdisc) { - qdisc->ops->attach(qdisc); dev->qdisc = qdisc; + qdisc->ops->attach(qdisc); } } } |