diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2006-05-24 00:20:25 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-05-24 00:20:25 +0200 |
commit | 387e2b0439026aa738a9edca15a57e5c0bcb4dfc (patch) | |
tree | 5d4e0349a0119fcff5278c1077b2b2888933d441 /net/bridge/br.c | |
parent | [NETFILTER]: SNMP NAT: fix memleak in snmp_object_decode (diff) | |
download | linux-387e2b0439026aa738a9edca15a57e5c0bcb4dfc.tar.xz linux-387e2b0439026aa738a9edca15a57e5c0bcb4dfc.zip |
[BRIDGE]: need to ref count the LLC sap
Bridge will OOPS on removal if other application has the SAP open.
The bridge SAP might be shared with other usages, so need
to do reference counting on module removal rather than explicit
close/delete.
Since packet might arrive after or during removal, need to clear
the receive function handle, so LLC only hands it to user (if any).
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | net/bridge/br.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bridge/br.c b/net/bridge/br.c index 22d806cf40ca..12da21afb9ca 100644 --- a/net/bridge/br.c +++ b/net/bridge/br.c @@ -55,7 +55,7 @@ static int __init br_init(void) static void __exit br_deinit(void) { - llc_sap_close(br_stp_sap); + rcu_assign_pointer(br_stp_sap->rcv_func, NULL); #ifdef CONFIG_BRIDGE_NETFILTER br_netfilter_fini(); @@ -67,6 +67,7 @@ static void __exit br_deinit(void) synchronize_net(); + llc_sap_put(br_stp_sap); br_fdb_get_hook = NULL; br_fdb_put_hook = NULL; |