Skip to content

Commit

Permalink
[NETFILTER]: nf_log: use rcu_assign_pointer for RCU protected pointer
Browse files Browse the repository at this point in the history
Also replace synchronize_net() calls by synchronize_rcu() since the
RCU protected data is also used for sysfs.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Feb 12, 2007
1 parent fd706d6 commit a5ea616
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/netfilter/nf_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ int nf_log_unregister_pf(int pf)
return -EINVAL;

spin_lock(&nf_log_lock);
nf_logging[pf] = NULL;
rcu_assign_pointer(nf_logging[pf], NULL);
spin_unlock(&nf_log_lock);

/* Give time to concurrent readers. */
synchronize_net();
synchronize_rcu();

return 0;
}
Expand All @@ -63,11 +63,11 @@ void nf_log_unregister_logger(struct nf_logger *logger)
spin_lock(&nf_log_lock);
for (i = 0; i < NPROTO; i++) {
if (nf_logging[i] == logger)
nf_logging[i] = NULL;
rcu_assign_pointer(nf_logging[i], NULL);
}
spin_unlock(&nf_log_lock);

synchronize_net();
synchronize_rcu();
}
EXPORT_SYMBOL(nf_log_unregister_logger);

Expand Down

0 comments on commit a5ea616

Please sign in to comment.