]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: Fix dump of MPLS_OPT_LSE_LABEL attribute in cls_flower
authorGuillaume Nault <gnault@redhat.com>
Wed, 9 Dec 2020 15:48:41 +0000 (16:48 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Dec 2020 04:39:38 +0000 (20:39 -0800)
commit82a52ad73062680cf8409a7df393348db24543da
tree4e703e992f72ae80e63cec10802a9d69c86b47ce
parente410be6ce57020c17eb325ce132e88eb2bddb6f6
net: sched: Fix dump of MPLS_OPT_LSE_LABEL attribute in cls_flower

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: eecd9dabea43 ("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>
net/sched/cls_flower.c