From: "Roberto García" <rodanber@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: "Roberto García" <rodanber@gmail.com>
Subject: [PATCH] extensions: libip6t_LOG: Avoid to print the default log level in the translation
Date: Fri, 11 Mar 2016 20:49:32 +0100 [thread overview]
Message-ID: <1457725772-10913-1-git-send-email-rodanber@gmail.com> (raw)
Remove the log level when default is used
Before:
$ sudo iptables-translate -I INPUT -j LOG
nft add rule filter INPUT log level warning
After:
$ sudo iptables-translate -I INPUT -j LOG
nft add rule filter INPUT counter log
---
extensions/libip6t_LOG.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/extensions/libip6t_LOG.c b/extensions/libip6t_LOG.c
index 7841e57..3c5075e 100644
--- a/extensions/libip6t_LOG.c
+++ b/extensions/libip6t_LOG.c
@@ -194,7 +194,8 @@ static int LOG_xlate(const void *ip, const struct xt_entry_target *target,
xt_xlate_add(xl, "prefix \\\"%s\\\" ", loginfo->prefix);
for (i = 0; i < ARRAY_SIZE(ip6t_log_xlate_names); ++i)
- if (loginfo->level == ip6t_log_xlate_names[i].level) {
+ if (loginfo->level == ip6t_log_xlate_names[i].level &&
+ loginfo->level != LOG_DEFAULT_LEVEL) {
xt_xlate_add(xl, "level %s",
ip6t_log_xlate_names[i].name);
break;
--
2.7.2
next reply other threads:[~2016-03-11 19:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 19:49 Roberto García [this message]
2016-03-12 11:42 ` [PATCH] extensions: libip6t_LOG: Avoid to print the default log level in the translation Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457725772-10913-1-git-send-email-rodanber@gmail.com \
--to=rodanber@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).