path: root/extensions/libxt_NFLOG.c
diff options
authorLiping Zhang <>2016-07-18 22:14:28 +0800
committerPablo Neira Ayuso <>2016-07-19 20:18:50 +0200
commitf280adca86dfb8ba4d5a3d5a309f9252cc02f2ca (patch)
tree40c76f4a7169d5622597bef52dfdad8c53313c9b /extensions/libxt_NFLOG.c
parent4bde4cc6721e460a1896bf4be2b44fb2ed05b240 (diff)
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 <>
Diffstat (limited to 'extensions/libxt_NFLOG.c')
1 files changed, 1 insertions, 1 deletions
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);