• Kuniyuki Iwashima's avatar
    rtnetlink: Add bulk registration helpers for rtnetlink message handlers. · 07cc7b0b
    Kuniyuki Iwashima authored
    Before commit addf9b90 ("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: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    07cc7b0b
rtnetlink.c 166 KB