[PATCH] netfilter: desactivate nf_log logger via sysctl.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds support for unbind of logger via sysctl. By echoing
"NONE" to a /proc/sys/net/netfilter/nf_log/PROTO file, the logger
corresponding to this PROTO is set to NULL.

Signed-off-by: Eric Leblond <eric@xxxxxx>
---
 net/netfilter/nf_log.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index d4b5259..4775700 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -252,6 +252,10 @@ static int nf_log_proc_dostring(ctl_table *table, int write, struct file *filp,
 
 	rcu_read_lock();
 	if (write) {
+		if (!strnicmp(buffer, "NONE", *lenp - 1)) {
+			rcu_read_unlock();
+			return nf_log_unbind_pf(table->ctl_name);
+		}
 		logger = __find_logger_n(table->ctl_name, buffer, *lenp -1);
 		if (logger == NULL) {
 			rcu_read_unlock();
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux