diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-10-27 01:51:06 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-10 18:39:23 +0300 |
commit | fa6810e7d4008ad73ca41964dd2c080752f79f84 (patch) | |
tree | 9a432013e908d4bbafc21c55ad979e46a345d9a2 /net/sched/sch_gred.c | |
parent | 0e71018abef66f39cf1079ac65561dea14645f7d (diff) | |
download | linux-fa6810e7d4008ad73ca41964dd2c080752f79f84.tar.xz |
net: sched: gred: pass the right attribute to gred_change_table_def()
[ Upstream commit 38b4f18d56372e1e21771ab7b0357b853330186c ]
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: f62d6b936df5 ("[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>
Diffstat (limited to 'net/sched/sch_gred.c')
-rw-r--r-- | net/sched/sch_gred.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c index 5d004ecdbefd..e58ae7c1c3ed 100644 --- a/net/sched/sch_gred.c +++ b/net/sched/sch_gred.c @@ -437,7 +437,7 @@ static int gred_change(struct Qdisc *sch, struct nlattr *opt) return err; if (tb[TCA_GRED_PARMS] == NULL && tb[TCA_GRED_STAB] == NULL) - return gred_change_table_def(sch, opt); + return gred_change_table_def(sch, tb[TCA_GRED_DPS]); if (tb[TCA_GRED_PARMS] == NULL || tb[TCA_GRED_STAB] == NULL) |