mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-14 15:54:15 +08:00
net: sched: gred: pass the right attribute to gred_change_table_def()
[ Upstream commit38b4f18d56
] gred_change_table_def() takes a pointer to TCA_GRED_DPS attribute, and expects it will be able to interpret its contents as struct tc_gred_sopt. Pass the correct gred attribute, instead of TCA_OPTIONS. This bug meant the table definition could never be changed after Qdisc was initialized (unless whatever TCA_OPTIONS contained both passed netlink validation and was a valid struct tc_gred_sopt...). Old behaviour: $ ip link add type dummy $ tc qdisc replace dev dummy0 parent root handle 7: \ gred setup vqs 4 default 0 $ tc qdisc replace dev dummy0 parent root handle 7: \ gred setup vqs 4 default 0 RTNETLINK answers: Invalid argument Now: $ ip link add type dummy $ tc qdisc replace dev dummy0 parent root handle 7: \ gred setup vqs 4 default 0 $ tc qdisc replace dev dummy0 parent root handle 7: \ gred setup vqs 4 default 0 $ tc qdisc replace dev dummy0 parent root handle 7: \ gred setup vqs 4 default 0 Fixes:f62d6b936d
("[PKT_SCHED]: GRED: Use central VQ change procedure") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e581e28f9d
commit
29d871195e
@ -411,7 +411,7 @@ static int gred_change(struct Qdisc *sch, struct nlattr *opt)
|
||||
if (tb[TCA_GRED_PARMS] == NULL && tb[TCA_GRED_STAB] == NULL) {
|
||||
if (tb[TCA_GRED_LIMIT] != NULL)
|
||||
sch->limit = nla_get_u32(tb[TCA_GRED_LIMIT]);
|
||||
return gred_change_table_def(sch, opt);
|
||||
return gred_change_table_def(sch, tb[TCA_GRED_DPS]);
|
||||
}
|
||||
|
||||
if (tb[TCA_GRED_PARMS] == NULL ||
|
||||
|
Loading…
Reference in New Issue
Block a user