[libnftnl] Expose socket mark via socket expression

Message ID 20180711225214.5515-1-ecklm94@gmail.com
State Under Review
Delegated to: Pablo Neira
Headers show
Series
  • [libnftnl] Expose socket mark via socket expression
Related show

Commit Message

Máté Eckl July 11, 2018, 10:52 p.m.
Signed-off-by: Máté Eckl <ecklm94@gmail.com>
---
 include/linux/netfilter/nf_tables.h | 4 +++-
 src/expr/socket.c                   | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

Patch

diff --git a/include/linux/netfilter/nf_tables.h b/include/linux/netfilter/nf_tables.h
index 91449ef..eef157d 100644
--- a/include/linux/netfilter/nf_tables.h
+++ b/include/linux/netfilter/nf_tables.h
@@ -921,10 +921,12 @@  enum nft_socket_attributes {
 /*
  * enum nft_socket_keys - nf_tables socket expression keys
  *
- * @NFT_SOCKET_TRANSPARENT: Value of the IP(V6)_TRANSPARENT socket option_
+ * @NFT_SOCKET_TRANSPARENT: Value of the IP(V6)_TRANSPARENT socket option
+ * @NFT_SOCKET_MARK: Value of the socket mark
  */
 enum nft_socket_keys {
 	NFT_SOCKET_TRANSPARENT,
+	NFT_SOCKET_MARK,
 	__NFT_SOCKET_MAX
 };
 #define NFT_SOCKET_MAX	(__NFT_SOCKET_MAX - 1)
diff --git a/src/expr/socket.c b/src/expr/socket.c
index db160a1..5fa2ef2 100644
--- a/src/expr/socket.c
+++ b/src/expr/socket.c
@@ -114,6 +114,7 @@  nftnl_expr_socket_parse(struct nftnl_expr *e, struct nlattr *attr)
 
 static const char *socket_key2str_array[NFT_SOCKET_MAX + 1] = {
 	[NFT_SOCKET_TRANSPARENT] = "transparent",
+	[NFT_SOCKET_MARK] = "mark",
 };
 
 static const char *socket_key2str(uint8_t key)