Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=32fe21c0c0a3091552fea8f2f7e4905f547a3433
Commit:     32fe21c0c0a3091552fea8f2f7e4905f547a3433
Parent:     c127ea2c45d1b13a672fde254679721bb282e90a
Author:     Thomas Graf <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 22 11:59:03 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:27:14 2007 -0700

    [BRIDGE]: Use rtnl registration interface
    
    Signed-off-by: Thomas Graf <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/bridge/br.c         |    8 ++++++--
 net/bridge/br_netlink.c |   20 ++++++++++----------
 net/bridge/br_private.h |    2 +-
 3 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/net/bridge/br.c b/net/bridge/br.c
index 2994387..601c37d 100644
--- a/net/bridge/br.c
+++ b/net/bridge/br.c
@@ -47,7 +47,10 @@ static int __init br_init(void)
        if (err)
                goto err_out2;
 
-       br_netlink_init();
+       err = br_netlink_init();
+       if (err)
+               goto err_out3;
+
        brioctl_set(br_ioctl_deviceless_stub);
        br_handle_frame_hook = br_handle_frame;
 
@@ -55,7 +58,8 @@ static int __init br_init(void)
        br_fdb_put_hook = br_fdb_put;
 
        return 0;
-
+err_out3:
+       unregister_netdevice_notifier(&br_device_notifier);
 err_out2:
        br_netfilter_fini();
 err_out1:
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 7d68b24..a14ac51 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -11,8 +11,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/rtnetlink.h>
-#include <net/netlink.h>
+#include <net/rtnetlink.h>
 #include "br_private.h"
 
 static 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)
 }
 
 
-static struct rtnetlink_link bridge_rtnetlink_table[RTM_NR_MSGTYPES] = {
-       [RTM_GETLINK - RTM_BASE] = { .dumpit    = br_dump_ifinfo, },
-       [RTM_SETLINK - RTM_BASE] = { .doit      = br_rtm_setlink, },
-};
-
-void __init br_netlink_init(void)
+int __init br_netlink_init(void)
 {
-       rtnetlink_links[PF_BRIDGE] = bridge_rtnetlink_table;
+       if (__rtnl_register(PF_BRIDGE, RTM_GETLINK, NULL, br_dump_ifinfo))
+               return -ENOBUFS;
+
+       /* Only the first call to __rtnl_register can fail */
+       __rtnl_register(PF_BRIDGE, RTM_SETLINK, br_rtm_setlink, NULL);
+
+       return 0;
 }
 
 void __exit br_netlink_fini(void)
 {
-       rtnetlink_links[PF_BRIDGE] = NULL;
+       rtnl_unregister_all(PF_BRIDGE);
 }
 
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index cc3f1c9..2b73de6 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -235,7 +235,7 @@ extern void (*br_fdb_put_hook)(struct net_bridge_fdb_entry 
*ent);
 
 
 /* br_netlink.c */
-extern void br_netlink_init(void);
+extern int br_netlink_init(void);
 extern void br_netlink_fini(void);
 extern void br_ifinfo_notify(int event, struct net_bridge_port *port);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to