Skip to content

Commit c82b031

Browse files
q2venkuba-moo
authored andcommitted
dcb: Use rtnl_register_many().
We will remove rtnl_register() in favour of rtnl_register_many(). When it succeeds, rtnl_register_many() guarantees all rtnetlink types in the passed array are supported, and there is no chance that a part of message types is not supported. Let's use rtnl_register_many() instead. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20241014201828.91221-10-kuniyu@amazon.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 3ac84e3 commit c82b031

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

net/dcb/dcbnl.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,6 +2408,11 @@ static struct notifier_block dcbnl_nb __read_mostly = {
24082408
.notifier_call = dcbnl_netdevice_event,
24092409
};
24102410

2411+
static const struct rtnl_msg_handler dcbnl_rtnl_msg_handlers[] __initconst = {
2412+
{.msgtype = RTM_GETDCB, .doit = dcb_doit},
2413+
{.msgtype = RTM_SETDCB, .doit = dcb_doit},
2414+
};
2415+
24112416
static int __init dcbnl_init(void)
24122417
{
24132418
int err;
@@ -2416,8 +2421,7 @@ static int __init dcbnl_init(void)
24162421
if (err)
24172422
return err;
24182423

2419-
rtnl_register(PF_UNSPEC, RTM_GETDCB, dcb_doit, NULL, 0);
2420-
rtnl_register(PF_UNSPEC, RTM_SETDCB, dcb_doit, NULL, 0);
2424+
rtnl_register_many(dcbnl_rtnl_msg_handlers);
24212425

24222426
return 0;
24232427
}

0 commit comments

Comments
 (0)