Avoid to print the log level in the translation when the level is the default value. Example: $ sudo iptables-translate -t filter -A INPUT -m icmp ! --icmp-type 10 -j LOG nft add rule ip filter INPUT icmp type != router-solicitation counter log Signed-off-by: Laura Garcia Liebana <nevola@xxxxxxxxx> --- extensions/libipt_LOG.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/libipt_LOG.c b/extensions/libipt_LOG.c index f3875b6..216b1ca 100644 --- a/extensions/libipt_LOG.c +++ b/extensions/libipt_LOG.c @@ -194,7 +194,8 @@ static int LOG_xlate(const struct xt_entry_target *target, xt_xlate_add(xl, "prefix \\\"%s\\\" ", loginfo->prefix); for (i = 0; i < ARRAY_SIZE(ipt_log_xlate_names); ++i) - if (loginfo->level == ipt_log_xlate_names[i].level) { + if (loginfo->level != LOG_DEFAULT_LEVEL && + loginfo->level == ipt_log_xlate_names[i].level) { xt_xlate_add(xl, "level %s ", ipt_log_xlate_names[i].name); break; -- 2.7.0 -- 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