diff options
author | Guillaume Nault <gnault@redhat.com> | 2020-12-09 16:48:41 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-21 13:28:18 +0100 |
commit | c005fb4bcd55d5880ea2a68dedcb85086513ff92 (patch) | |
tree | 06399d12d116f96f3054eecc04be37e17d761fd5 | |
parent | b0305b646f513b19254bbbe06c8f2594fef497a5 (diff) | |
download | linux-stable-c005fb4bcd55d5880ea2a68dedcb85086513ff92.tar.gz linux-stable-c005fb4bcd55d5880ea2a68dedcb85086513ff92.tar.bz2 linux-stable-c005fb4bcd55d5880ea2a68dedcb85086513ff92.zip |
net: sched: Fix dump of MPLS_OPT_LSE_LABEL attribute in cls_flower
[ Upstream commit 7fdd375e383097a785bb65c66802e468f398bf82 ]
TCA_FLOWER_KEY_MPLS_OPT_LSE_LABEL is a u32 attribute (MPLS label is
20 bits long).
Fixes the following bug:
$ tc filter add dev ethX ingress protocol mpls_uc \
flower mpls lse depth 2 label 256 \
action drop
$ tc filter show dev ethX ingress
filter protocol mpls_uc pref 49152 flower chain 0
filter protocol mpls_uc pref 49152 flower chain 0 handle 0x1
eth_type 8847
mpls
lse depth 2 label 0 <-- invalid label 0, should be 256
...
Fixes: 61aec25a6db5 ("cls_flower: Support filtering on multiple MPLS Label Stack Entries")
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | net/sched/cls_flower.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index fed18fd2c50b..1319986693fc 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -2424,8 +2424,8 @@ static int fl_dump_key_mpls_opt_lse(struct sk_buff *skb, return err; } if (lse_mask->mpls_label) { - err = nla_put_u8(skb, TCA_FLOWER_KEY_MPLS_OPT_LSE_LABEL, - lse_key->mpls_label); + err = nla_put_u32(skb, TCA_FLOWER_KEY_MPLS_OPT_LSE_LABEL, + lse_key->mpls_label); if (err) return err; } |