From: Liping Zhang Date: Mon, 18 Jul 2016 14:14:28 +0000 (+0800) Subject: extensions: libxt_NFLOG: translate to nft log snaplen if nflog-size is specified X-Git-Tag: v1.6.1~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f280adca86dfb8ba4d5a3d5a309f9252cc02f2ca;p=thirdparty%2Fiptables.git extensions: libxt_NFLOG: translate to nft log snaplen if nflog-size is specified The nflog-size was introduced by commit 7070b1f3c88a ("extensions: libxt_NFLOG: nflog-range does not truncate packets"). Then make the nflog-range become deprecated, because it has no effect from the beginning. So when we do translation, nft log snaplen is translated only if the nflog-size is specified. Signed-off-by: Liping Zhang Signed-off-by: Pablo Neira Ayuso --- diff --git a/extensions/libxt_NFLOG.c b/extensions/libxt_NFLOG.c index a747951a..dad83f6e 100644 --- a/extensions/libxt_NFLOG.c +++ b/extensions/libxt_NFLOG.c @@ -112,7 +112,7 @@ static void nflog_print_xlate(const struct xt_nflog_info *info, xt_xlate_add(xl, "log "); if (info->prefix[0] != '\0') xt_xlate_add(xl, "prefix \\\"%s\\\" ", info->prefix); - if (info->len) + if (info->flags & XT_NFLOG_F_COPY_LEN) xt_xlate_add(xl, "snaplen %u ", info->len); if (info->threshold != XT_NFLOG_DEFAULT_THRESHOLD) xt_xlate_add(xl, "queue-threshold %u ", info->threshold);