]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: sched: fix erspan_opt settings in cls_flower
authorXin Long <lucien.xin@gmail.com>
Mon, 2 Dec 2024 15:21:38 +0000 (10:21 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:28 +0000 (19:51 +0100)
commitc7d644f76949ff3b103787bab070108fec6c2165
tree0c9c5f011c316bf13ec9493498719272c29eb845
parent4fe517643f529e805bb6b890a4331c100e8f2484
net: sched: fix erspan_opt settings in cls_flower

[ Upstream commit 292207809486d99c78068d3f459cbbbffde88415 ]

When matching erspan_opt in cls_flower, only the (version, dir, hwid)
fields are relevant. However, in fl_set_erspan_opt() it initializes
all bits of erspan_opt and its mask to 1. This inadvertently requires
packets to match not only the (version, dir, hwid) fields but also the
other fields that are unexpectedly set to 1.

This patch resolves the issue by ensuring that only the (version, dir,
hwid) fields are configured in fl_set_erspan_opt(), leaving the other
fields to 0 in erspan_opt.

Fixes: 79b1011cb33d ("net: sched: allow flower to match erspan options")
Reported-by: Shuang Li <shuali@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sched/cls_flower.c