]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
bridge: Do not unregister all PF_BRIDGE rtnl operations
authorVlad Yasevich <vyasevic@redhat.com>
Wed, 19 Dec 2012 09:13:48 +0000 (09:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Dec 2012 20:50:06 +0000 (12:50 -0800)
Bridge fdb and link rtnl operations are registered in
core/rtnetlink.  Bridge mdb operations are registred
in bridge/mdb.  When removing bridge module, do not
unregister ALL PF_BRIDGE ops since that would remove
the ops from rtnetlink as well.  Do remove mdb ops when
bridge is destroyed.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_mdb.c
net/bridge/br_multicast.c
net/bridge/br_netlink.c
net/bridge/br_private.h

index 9cf5d2b28c7683aee7d66ab849e6a41e5fba2d79..3e05cc32da500378c87d34e5ab0a2fab979b5832 100644 (file)
@@ -482,3 +482,10 @@ void br_mdb_init(void)
        rtnl_register(PF_BRIDGE, RTM_NEWMDB, br_mdb_add, NULL, NULL);
        rtnl_register(PF_BRIDGE, RTM_DELMDB, br_mdb_del, NULL, NULL);
 }
+
+void br_mdb_uninit(void)
+{
+       rtnl_unregister(PF_BRIDGE, RTM_GETMDB);
+       rtnl_unregister(PF_BRIDGE, RTM_NEWMDB);
+       rtnl_unregister(PF_BRIDGE, RTM_DELMDB);
+}
index dce9defae3c68aa706dcf7111497481b5204d57f..5391ca43336a7d518c1640f855ecc7b739ce7226 100644 (file)
@@ -1633,6 +1633,7 @@ void br_multicast_stop(struct net_bridge *br)
        del_timer_sync(&br->multicast_querier_timer);
        del_timer_sync(&br->multicast_query_timer);
 
+       br_mdb_uninit();
        spin_lock_bh(&br->multicast_lock);
        mdb = mlock_dereference(br->mdb, br);
        if (!mdb)
index dead9dfe865b517247723d025cb0006cc5b44621..97ba0189c6f7c0cdba7c83491db620e2b409ae77 100644 (file)
@@ -305,5 +305,4 @@ int __init br_netlink_init(void)
 void __exit br_netlink_fini(void)
 {
        rtnl_link_unregister(&br_link_ops);
-       rtnl_unregister_all(PF_BRIDGE);
 }
index 49b85af44016bb41ff82470a7293200c3d60c4a3..8d83be5ffedcd8d04fdff6edf715947f56a1fbcc 100644 (file)
@@ -447,6 +447,7 @@ extern struct net_bridge_port_group *br_multicast_new_port_group(
                                struct net_bridge_port_group *next,
                                unsigned char state);
 extern void br_mdb_init(void);
+extern void br_mdb_uninit(void);
 extern void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port,
                          struct br_ip *group, int type);