Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6305
b: refs/heads/master
c: 8a61fad
h: refs/heads/master
i:
  6303: e7a9105
v: v3
  • Loading branch information
Harald Welte authored and David S. Miller committed Aug 29, 2005
1 parent 1591a3e commit 2082220
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d72367b6f36e557f122beefaa8c6b80eb1c7f245
refs/heads/master: 8a61fadb3908454ccfa538aaa75eb1d22def5700
2 changes: 1 addition & 1 deletion trunk/include/linux/netfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ struct nf_logger {

/* Function to register/unregister log function. */
int nf_log_register(int pf, struct nf_logger *logger);
void nf_log_unregister_pf(int pf);
int nf_log_unregister_pf(int pf);
void nf_log_unregister_logger(struct nf_logger *logger);

/* Calls the registered backend logging function */
Expand Down
10 changes: 9 additions & 1 deletion trunk/net/netfilter/nf_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ int nf_log_register(int pf, struct nf_logger *logger)
{
int ret = -EBUSY;

if (pf >= NPROTO)
return -EINVAL;

/* Any setup of logging members must be done before
* substituting pointer. */
spin_lock(&nf_log_lock);
Expand All @@ -38,14 +41,19 @@ int nf_log_register(int pf, struct nf_logger *logger)
}
EXPORT_SYMBOL(nf_log_register);

void nf_log_unregister_pf(int pf)
int nf_log_unregister_pf(int pf)
{
if (pf >= NPROTO)
return -EINVAL;

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

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

return 0;
}
EXPORT_SYMBOL(nf_log_unregister_pf);

Expand Down

0 comments on commit 2082220

Please sign in to comment.