From 208222050892c7b47955fbe2d8c074f2cf47b53c Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 9 Aug 2005 20:23:53 -0700 Subject: [PATCH] --- yaml --- r: 6305 b: refs/heads/master c: 8a61fadb3908454ccfa538aaa75eb1d22def5700 h: refs/heads/master i: 6303: e7a910558edcb4ac0632e6734f01e83fce7b75fb v: v3 --- [refs] | 2 +- trunk/include/linux/netfilter.h | 2 +- trunk/net/netfilter/nf_log.c | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 32c161e67378..d13412d1dbb9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d72367b6f36e557f122beefaa8c6b80eb1c7f245 +refs/heads/master: 8a61fadb3908454ccfa538aaa75eb1d22def5700 diff --git a/trunk/include/linux/netfilter.h b/trunk/include/linux/netfilter.h index bf430fcbe364..ac3c61411d4b 100644 --- a/trunk/include/linux/netfilter.h +++ b/trunk/include/linux/netfilter.h @@ -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 */ diff --git a/trunk/net/netfilter/nf_log.c b/trunk/net/netfilter/nf_log.c index e104760f7a67..573e76a770d9 100644 --- a/trunk/net/netfilter/nf_log.c +++ b/trunk/net/netfilter/nf_log.c @@ -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); @@ -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);