netfilter: nfnetlink_log: fix per-rule qthreshold override

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, March 2, 2009 - 5:00 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5ca431...
Commit:     5ca431f9ae8db8c6edb9c64bebe6d6521077afd6
Parent:     4aa3b2ee1945ed082430ae1fb988d60eef64ca07
Author:     Eric Leblond <eric@inl.fr>
AuthorDate: Wed Feb 18 15:29:23 2009 +0100
Committer:  Patrick McHardy <kaber@trash.net>
CommitDate: Wed Feb 18 15:29:23 2009 +0100

    netfilter: nfnetlink_log: fix per-rule qthreshold override
    
    In NFLOG the per-rule qthreshold should overrides per-instance only
    it is set. With current code, the per-rule qthreshold is 1 if not set
    and it overrides the per-instance qthreshold.
    
    This patch modifies the default xt_NFLOG threshold from 1 to
    0. Thus a value of 0 means there is no per-rule setting and the instance
    parameter has to apply.
    
    Signed-off-by: Eric Leblond <eric@inl.fr>
    Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 include/linux/netfilter/xt_NFLOG.h |    2 +-
 net/netfilter/nfnetlink_log.c      |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/linux/netfilter/xt_NFLOG.h b/include/linux/netfilter/xt_NFLOG.h
index cdcd0ed..4b36aeb 100644
--- a/include/linux/netfilter/xt_NFLOG.h
+++ b/include/linux/netfilter/xt_NFLOG.h
@@ -2,7 +2,7 @@
 #define _XT_NFLOG_TARGET
 
 #define XT_NFLOG_DEFAULT_GROUP		0x1
-#define XT_NFLOG_DEFAULT_THRESHOLD	1
+#define XT_NFLOG_DEFAULT_THRESHOLD	0
 
 #define XT_NFLOG_MASK			0x0
 
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index fa49dc7..580b837 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -590,8 +590,10 @@ nfulnl_log_packet(u_int8_t pf,
 
 	qthreshold = inst->qthreshold;
 	/* per-rule qthreshold overrides per-instance */
-	if (qthreshold > li->u.ulog.qthreshold)
-		qthreshold = li->u.ulog.qthreshold;
+	if (li->u.ulog.qthreshold)
+		if (qthreshold > li->u.ulog.qthreshold)
+			qthreshold = li->u.ulog.qthreshold;
+
 
 	switch (inst->copy_mode) {
 	case NFULNL_COPY_META:
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
netfilter: nfnetlink_log: fix per-rule qthreshold override, Linux Kernel Mailing ..., (Mon Mar 2, 5:00 pm)