]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: netlink: add NLM_F_BULK delete request modifier
authorNikolay Aleksandrov <razor@blackwall.org>
Wed, 13 Apr 2022 10:51:54 +0000 (13:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:03:10 +0000 (14:03 +0100)
[ Upstream commit 545528d788556c724eeb5400757f828ef27782a8 ]

Add a new delete request modifier called NLM_F_BULK which, when
supported, would cause the request to delete multiple objects. The flag
is a convenient way to signal that a multiple delete operation is
requested which can be gradually added to different delete requests. In
order to make sure older kernels will error out if the operation is not
supported instead of doing something unintended we have to break a
required condition when implementing support for this flag, f.e. for
neighbors we will omit the mandatory mac address attribute.
Initially it will be used to add flush with filtering support for bridge
fdbs, but it also opens the door to add similar support to others.

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: bf29555f5bdc ("rtnetlink: Allow deleting FDB entries in user namespace")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/uapi/linux/netlink.h

index 4940a933159952f92bfd4a65b4e77796020254d9..1e543cf0568c040925b436316e26a8ad53ea4983 100644 (file)
@@ -72,6 +72,7 @@ struct nlmsghdr {
 
 /* Modifiers to DELETE request */
 #define NLM_F_NONREC   0x100   /* Do not delete recursively    */
+#define NLM_F_BULK     0x200   /* Delete multiple objects      */
 
 /* Flags for ACK message */
 #define NLM_F_CAPPED   0x100   /* request was capped */