aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge/br_netlink.c')
-rw-r--r--net/bridge/br_netlink.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 7d68b24b5654..a14ac51753e6 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -11,8 +11,7 @@
11 */ 11 */
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/rtnetlink.h> 14#include <net/rtnetlink.h>
15#include <net/netlink.h>
16#include "br_private.h" 15#include "br_private.h"
17 16
18static inline size_t br_nlmsg_size(void) 17static inline size_t br_nlmsg_size(void)
@@ -179,18 +178,19 @@ static int br_rtm_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
179} 178}
180 179
181 180
182static struct rtnetlink_link bridge_rtnetlink_table[RTM_NR_MSGTYPES] = { 181int __init br_netlink_init(void)
183 [RTM_GETLINK - RTM_BASE] = { .dumpit = br_dump_ifinfo, },
184 [RTM_SETLINK - RTM_BASE] = { .doit = br_rtm_setlink, },
185};
186
187void __init br_netlink_init(void)
188{ 182{
189 rtnetlink_links[PF_BRIDGE] = bridge_rtnetlink_table; 183 if (__rtnl_register(PF_BRIDGE, RTM_GETLINK, NULL, br_dump_ifinfo))
184 return -ENOBUFS;
185
186 /* Only the first call to __rtnl_register can fail */
187 __rtnl_register(PF_BRIDGE, RTM_SETLINK, br_rtm_setlink, NULL);
188
189 return 0;
190} 190}
191 191
192void __exit br_netlink_fini(void) 192void __exit br_netlink_fini(void)
193{ 193{
194 rtnetlink_links[PF_BRIDGE] = NULL; 194 rtnl_unregister_all(PF_BRIDGE);
195} 195}
196 196