log: netlink_linearize: don't set level if user didn't specify
Pablo Neira Ayuso
maintainerPATCH 1/1 log: netlink_linearize: don't set level if user didn't specify
The kernel will default on LOG_WARNING, to mimic iptables behaviour.
Reported-by Ana Rey <[email protected]>
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/netlink_linearize.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
src/netlink_linearize.c +4 -1
@@ -586,7 +586,10 @@ static void netlink_gen_log_stmt(struct netlink_linearize_ctx *ctx,nft_rule_expr_set_u16 (nle,NFT_EXPR_LOG_QTHRESHOLD , stmt->log.qthreshold); }else { -nft_rule_expr_set_u32 (nle,NFT_EXPR_LOG_LEVEL , stmt->log.level); +if (stmt->log.flags &STMT_LOG_LEVEL ) { +nft_rule_expr_set_u32 (nle,NFT_EXPR_LOG_LEVEL , + stmt->log.level); + } }nft_rule_add_expr (ctx->nlr, nle); }
Signature · 1 line
1.7.10.4