]> www.infradead.org Git - users/hch/misc.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)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 10 Oct 2024 13:39:35 +0000 (15:39 +0200)
commit07cc7b0b942bf55ef1a471470ecda8d2a6a6541f
tree198326270f4756e9313806fec12a8f0cfe691b53
parent9a3cd877dc93061fbbe0c834d53d89639e7ea46a
rtnetlink: Add bulk registration helpers for rtnetlink message handlers.

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>
include/net/rtnetlink.h
net/core/rtnetlink.c