Skip to contentSkip to conversation

expr: meta: Make NFT_META_{I,O}IFKIND known

PATCH Applied Phil Sutter 2 participants 2 messages Jul 18, 2019 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 expr: meta: Make NFT_META_{I,O}IFKIND known

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

---
 include/linux/netfilter/nf_tables.h | 4 ++++
 src/expr/meta.c                     | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
include/linux/netfilter/nf_tables.h +4 -0
index df6c706ccf093..8a9cd4cb3fa05 100644
@@ -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,
 };
 
 /**
src/expr/meta.c +3 -1
index ffcc8967b109d..f1984f6eb5c5b 100644
@@ -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)
Signature · 1 line
2.22.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Phil Sutter

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

Applied, thanks.