summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael Braun <michael-dev@fami-braun.de>2019-08-04 13:49:12 (GMT)
committerThomas Haller <thaller@redhat.com>2022-03-09 10:46:34 (GMT)
commit82664362585292252d9064813aff61301a779435 (patch)
tree4b3b0129b551a2edca22e9755598f7d8e179db0d /lib
parent246904df970090630291dfc7e22f92f93cd0d1f3 (diff)
downloadlibnl-82664362585292252d9064813aff61301a779435.zip
libnl-82664362585292252d9064813aff61301a779435.tar.gz
libnl-82664362585292252d9064813aff61301a779435.tar.bz2
nflog:add conntrack flag and enable flags for nflog
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/netfilter/log.c5
-rw-r--r--lib/netfilter/log_obj.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/netfilter/log.c b/lib/netfilter/log.c
index d8a60d8..c14a4ea 100644
--- a/lib/netfilter/log.c
+++ b/lib/netfilter/log.c
@@ -144,6 +144,11 @@ static int nfnl_log_build_request(const struct nfnl_log *log,
htonl(nfnl_log_get_queue_threshold(log))) < 0)
goto nla_put_failure;
+ if (nfnl_log_get_flags(log) &&
+ nla_put_u16(msg, NFULA_CFG_FLAGS,
+ htons(nfnl_log_get_flags(log))) < 0)
+ goto nla_put_failure;
+
*result = msg;
return 0;
diff --git a/lib/netfilter/log_obj.c b/lib/netfilter/log_obj.c
index aa44f7d..e26e5bd 100644
--- a/lib/netfilter/log_obj.c
+++ b/lib/netfilter/log_obj.c
@@ -208,9 +208,15 @@ void nfnl_log_unset_flags(struct nfnl_log *log, unsigned int flags)
log->log_flag_mask |= flags;
}
+unsigned int nfnl_log_get_flags(const struct nfnl_log *log)
+{
+ return log->log_flags;
+}
+
static const struct trans_tbl log_flags[] = {
__ADD(NFNL_LOG_FLAG_SEQ, seq),
__ADD(NFNL_LOG_FLAG_SEQ_GLOBAL, seq_global),
+ __ADD(NFNL_LOG_FLAG_CONNTRACK, conntrack),
};
char *nfnl_log_flags2str(unsigned int flags, char *buf, size_t len)