Skip to content

Commit

Permalink
[BRIDGE]: need to ref count the LLC sap
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed May 23, 2006
1 parent 4a06373 commit 387e2b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/bridge/br.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;

Expand Down

0 comments on commit 387e2b0

Please sign in to comment.