Netdev List
 help / color / mirror / Atom feed
* [PATCH] bridge: need to ref count the LLC sap
@ 2006-05-23 22:10 Stephen Hemminger
  2006-05-23 22:21 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2006-05-23 22:10 UTC (permalink / raw)
  To: David S. Miller, Arnaldo Carvalho de Melo; +Cc: netdev

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).

This should go in 2.616.stable and 2.6.17.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>


--- br.orig/net/bridge/br.c
+++ br/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;
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-24  0:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-23 22:10 [PATCH] bridge: need to ref count the LLC sap Stephen Hemminger
2006-05-23 22:21 ` David Miller
2006-05-24  0:36   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox