]> git.itanic.dy.fi Git - linux-stable/commit
rtnetlink: bridge: Use a different policy for MDB bulk delete
authorIdo Schimmel <idosch@nvidia.com>
Sun, 17 Dec 2023 08:32:37 +0000 (10:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Dec 2023 11:27:20 +0000 (11:27 +0000)
commite0cd06f7fcb51b8acd6e68e64cc805be1283de9d
tree68073cedd0734a8b5fd1525fe66ca334fad361ef
parente37a11fca41864c9f652ff81296b82e6f65a4242
rtnetlink: bridge: Use a different policy for MDB bulk delete

For MDB bulk delete we will need to validate 'MDBA_SET_ENTRY'
differently compared to regular delete. Specifically, allow the ifindex
to be zero (in case not filtering on bridge port) and force the address
to be zero as bulk delete based on address is not supported.

Do that by introducing a new policy and choosing the correct policy
based on the presence of the 'NLM_F_BULK' flag in the netlink message
header. Use nlmsg_parse() for strict validation.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c