net: sched: fix tc_u_common lookup
authorJiri Pirko <jiri@mellanox.com>
Tue, 13 Feb 2018 11:00:17 +0000 (12:00 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Feb 2018 17:29:02 +0000 (12:29 -0500)
commit339c21d7c459238135d87da8fefbfd25d98bc375
tree1c8eebd7b5da3e11d1374fe328dc4c254f47d4be
parentbb047ddd145860ff24820320a21f03cf8c071b22
net: sched: fix tc_u_common lookup

The offending commit wrongly assumes 1:1 mapping between block and q.
However, there are multiple blocks for a single q for classful qdiscs.
Since the obscure tc_u_common sharing mechanism expects it to be shared
among a qdisc, fix it by storing q pointer in case the block is not
shared.

Reported-by: Paweł Staszewski <pstaszewski@itcare.pl>
Reported-by: Cong Wang <xiyou.wangcong@gmail.com>
Fixes: 7fa9d974f3c2 ("net: sched: cls_u32: use block instead of q in tc_u_common")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_u32.c