* [PATCH libnftables] Add support for the connmark meta key
@ 2014-01-06 16:58 Kristian Evensen
0 siblings, 0 replies; only message in thread
From: Kristian Evensen @ 2014-01-06 16:58 UTC (permalink / raw)
To: netfilter-devel; +Cc: Kristian Evensen
From: Kristian Evensen <kristian.evensen@gmail.com>
This patch adds support for the connmark meta key, which enables
setting/retrieveing the connection mark of a tracked connection.
Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
---
include/linux/netfilter/nf_tables.h | 2 ++
src/expr/meta.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/linux/netfilter/nf_tables.h b/include/linux/netfilter/nf_tables.h
index e08f80e..5797501 100644
--- a/include/linux/netfilter/nf_tables.h
+++ b/include/linux/netfilter/nf_tables.h
@@ -452,6 +452,7 @@ enum nft_exthdr_attributes {
* @NFT_META_NFTRACE: packet nftrace bit
* @NFT_META_RTCLASSID: realm value of packet's route (skb->dst->tclassid)
* @NFT_META_SECMARK: packet secmark (skb->secmark)
+ * @NFT_META_CONNMARK: used to get/set the connection mark
*/
enum nft_meta_keys {
NFT_META_LEN,
@@ -469,6 +470,7 @@ enum nft_meta_keys {
NFT_META_NFTRACE,
NFT_META_RTCLASSID,
NFT_META_SECMARK,
+ NFT_META_CONNMARK,
};
/**
diff --git a/src/expr/meta.c b/src/expr/meta.c
index 6899d69..3264aa1 100644
--- a/src/expr/meta.c
+++ b/src/expr/meta.c
@@ -23,7 +23,7 @@
#include "expr_ops.h"
#ifndef NFT_META_MAX
-#define NFT_META_MAX (NFT_META_SECMARK + 1)
+#define NFT_META_MAX (NFT_META_CONNMARK + 1)
#endif
struct nft_expr_meta {
@@ -152,6 +152,7 @@ const char *meta_key2str_array[NFT_META_MAX] = {
[NFT_META_NFTRACE] = "nftrace",
[NFT_META_RTCLASSID] = "rtclassid",
[NFT_META_SECMARK] = "secmark",
+ [NFT_META_CONNMARK] = "connmark",
};
static const char *meta_key2str(uint8_t key)
--
1.8.3.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-01-06 16:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-06 16:58 [PATCH libnftables] Add support for the connmark meta key Kristian Evensen
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).