]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/net/openvswitch: add flow modify test
authorMinxi Hou <houminxi@gmail.com>
Tue, 9 Jun 2026 16:57:25 +0000 (00:57 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 11 Jun 2026 22:45:30 +0000 (15:45 -0700)
commit3e9201e4fe8bd78f4601a51212562505bbb60e3a
tree5c6d6fa28f4ecdafa4ae53f5c733bda76ee64c7c
parent7bc054c2d4ed1fa3560144fea41d91a87eaa25f1
selftests/net/openvswitch: add flow modify test

Add mod_flow() and the mod-flow CLI command to ovs-dpctl.py, exercising
OVS_FLOW_CMD_SET. Add test_flow_set which first modifies an existing
flow with new actions and verifies the change via traffic, then modifies
the same flow without actions and verifies the kernel handles the
no-actions case gracefully.

The no-actions path is unreachable from userspace OVS tools (dpctl
mod-flow requires actions) but reachable via raw netlink. This is the
code path where Adrian Moreno found a possible kfree_skb of ERR_PTR
when reply allocation fails after locking.

Make parse() skip OVS_FLOW_ATTR_ACTIONS when actstr is None so the
kernel enters the post-lock allocation branch in ovs_flow_cmd_set().
After the no-actions set, verify via dump-flows that the flow retained
its drop action.

Suggested-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Minxi Hou <houminxi@gmail.com>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Link: https://patch.msgid.link/20260609165725.107484-1-houminxi@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/openvswitch/openvswitch.sh
tools/testing/selftests/net/openvswitch/ovs-dpctl.py