diff options
author | Vlad Yasevich <vyasevic@redhat.com> | 2013-01-02 09:41:25 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-03 01:56:11 -0800 |
commit | 3ec8e9f085bcaef0de1077f555c2c5102c223390 (patch) | |
tree | 45f31e75a2e5913eb7de444c7ebe6dc13dcd9859 /net/bridge/br_netlink.c | |
parent | 612a7c4e73f3306f3b599c60681194c1931a2dbc (diff) | |
download | lwn-3ec8e9f085bcaef0de1077f555c2c5102c223390.tar.gz lwn-3ec8e9f085bcaef0de1077f555c2c5102c223390.zip |
bridge: Correctly unregister MDB rtnetlink handlers
Commit 63233159fd4e596568f5f168ecb0879b61631d47:
bridge: Do not unregister all PF_BRIDGE rtnl operations
introduced a bug where a removal of a single bridge from a
multi-bridge system would remove MDB netlink handlers.
The handlers should only be removed once all bridges are gone, but
since we don't keep track of the number of bridge interfaces, it's
simpler to do it when the bridge module is unloaded. To make it
consistent, move the registration code into module initialization
code path.
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_netlink.c')
-rw-r--r-- | net/bridge/br_netlink.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index 97ba0189c6f7..5dc66abcc9e2 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c @@ -299,10 +299,21 @@ struct rtnl_link_ops br_link_ops __read_mostly = { int __init br_netlink_init(void) { - return rtnl_link_register(&br_link_ops); + int err; + + br_mdb_init(); + err = rtnl_link_register(&br_link_ops); + if (err) + goto out; + + return 0; +out: + br_mdb_uninit(); + return err; } void __exit br_netlink_fini(void) { + br_mdb_uninit(); rtnl_link_unregister(&br_link_ops); } |