[libnftnl PATCH] expr: meta: Make NFT_META_{I,O}IFKIND known

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This only affects debug output, the key was properly handled in
productive code paths already.

Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 include/linux/netfilter/nf_tables.h | 4 ++++
 src/expr/meta.c                     | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/linux/netfilter/nf_tables.h b/include/linux/netfilter/nf_tables.h
index df6c706ccf093..8a9cd4cb3fa05 100644
--- a/include/linux/netfilter/nf_tables.h
+++ b/include/linux/netfilter/nf_tables.h
@@ -793,6 +793,8 @@ enum nft_exthdr_attributes {
  * @NFT_META_CGROUP: socket control group (skb->sk->sk_classid)
  * @NFT_META_PRANDOM: a 32bit pseudo-random number
  * @NFT_META_SECPATH: boolean, secpath_exists (!!skb->sp)
+ * @NFT_META_IIFKIND: packet input interface kind name (dev->rtnl_link_ops->kind)
+ * @NFT_META_OIFKIND: packet output interface kind name (dev->rtnl_link_ops->kind)
  */
 enum nft_meta_keys {
 	NFT_META_LEN,
@@ -821,6 +823,8 @@ enum nft_meta_keys {
 	NFT_META_CGROUP,
 	NFT_META_PRANDOM,
 	NFT_META_SECPATH,
+	NFT_META_IIFKIND,
+	NFT_META_OIFKIND,
 };
 
 /**
diff --git a/src/expr/meta.c b/src/expr/meta.c
index ffcc8967b109d..f1984f6eb5c5b 100644
--- a/src/expr/meta.c
+++ b/src/expr/meta.c
@@ -22,7 +22,7 @@
 #include <libnftnl/rule.h>
 
 #ifndef NFT_META_MAX
-#define NFT_META_MAX (NFT_META_SECPATH + 1)
+#define NFT_META_MAX (NFT_META_OIFKIND + 1)
 #endif
 
 struct nftnl_expr_meta {
@@ -159,6 +159,8 @@ static const char *meta_key2str_array[NFT_META_MAX] = {
 	[NFT_META_CGROUP]	= "cgroup",
 	[NFT_META_PRANDOM]	= "prandom",
 	[NFT_META_SECPATH]	= "secpath",
+	[NFT_META_IIFKIND]	= "iifkind",
+	[NFT_META_OIFKIND]	= "oifkind",
 };
 
 static const char *meta_key2str(uint8_t key)
-- 
2.22.0




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux