Commit 5ca431f9 authored by Eric Leblond's avatar Eric Leblond Committed by Patrick McHardy

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: default avatarEric Leblond <eric@inl.fr>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 4aa3b2ee
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define _XT_NFLOG_TARGET #define _XT_NFLOG_TARGET
#define XT_NFLOG_DEFAULT_GROUP 0x1 #define XT_NFLOG_DEFAULT_GROUP 0x1
#define XT_NFLOG_DEFAULT_THRESHOLD 1 #define XT_NFLOG_DEFAULT_THRESHOLD 0
#define XT_NFLOG_MASK 0x0 #define XT_NFLOG_MASK 0x0
......
...@@ -590,9 +590,11 @@ nfulnl_log_packet(u_int8_t pf, ...@@ -590,9 +590,11 @@ nfulnl_log_packet(u_int8_t pf,
qthreshold = inst->qthreshold; qthreshold = inst->qthreshold;
/* per-rule qthreshold overrides per-instance */ /* per-rule qthreshold overrides per-instance */
if (li->u.ulog.qthreshold)
if (qthreshold > li->u.ulog.qthreshold) if (qthreshold > li->u.ulog.qthreshold)
qthreshold = li->u.ulog.qthreshold; qthreshold = li->u.ulog.qthreshold;
switch (inst->copy_mode) { switch (inst->copy_mode) {
case NFULNL_COPY_META: case NFULNL_COPY_META:
case NFULNL_COPY_NONE: case NFULNL_COPY_NONE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment