]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rtnetlink: Add bulk registration helpers for rtnetlink message handlers.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Tue, 8 Oct 2024 18:47:32 +0000 (11:47 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:57 +0000 (15:11 +0200)
commit947acd1b09b04e1b1df4f6dce9d315941204f7b3
treeac3f79828ca3e3b83df220cf2ab191454b78cec4
parent21d30b12695a8bc1a600b47d3792378f402dc453
rtnetlink: Add bulk registration helpers for rtnetlink message handlers.

[ Upstream commit 07cc7b0b942bf55ef1a471470ecda8d2a6a6541f ]

Before commit addf9b90de22 ("net: rtnetlink: use rcu to free rtnl message
handlers"), once rtnl_msg_handlers[protocol] was allocated, the following
rtnl_register_module() for the same protocol never failed.

However, after the commit, rtnl_msg_handler[protocol][msgtype] needs to
be allocated in each rtnl_register_module(), so each call could fail.

Many callers of rtnl_register_module() do not handle the returned error,
and we need to add many error handlings.

To handle that easily, let's add wrapper functions for bulk registration
of rtnetlink message handlers.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: d51705614f66 ("mctp: Handle error of rtnl_register_module().")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/rtnetlink.h
net/core/rtnetlink.c