[PATCH libnftnl] expr: meta: introduce broute meta expression

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

 



libnftnl support for broute meta statement introduced in [1].
[1]: https://patchwork.ozlabs.org/project/netfilter-devel/patch/20230224095251.11249-1-sriram.yagnaraman@xxxxxxxx/

Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman@xxxxxxxx>
---
 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 4608646..c48b193 100644
--- a/include/linux/netfilter/nf_tables.h
+++ b/include/linux/netfilter/nf_tables.h
@@ -914,6 +914,7 @@ enum nft_exthdr_attributes {
  * @NFT_META_TIME_HOUR: hour of day (in seconds)
  * @NFT_META_SDIF: slave device interface index
  * @NFT_META_SDIFNAME: slave device interface name
+ * @NFT_META_BRI_BROUTE: packet br_netfilter_broute bit
  */
 enum nft_meta_keys {
 	NFT_META_LEN,
@@ -952,6 +953,7 @@ enum nft_meta_keys {
 	NFT_META_TIME_HOUR,
 	NFT_META_SDIF,
 	NFT_META_SDIFNAME,
+	NFT_META_BRI_BROUTE,
 	__NFT_META_IIFTYPE,
 };
 
diff --git a/src/expr/meta.c b/src/expr/meta.c
index 96544a4..183f441 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_SDIFNAME + 1)
+#define NFT_META_MAX (NFT_META_BRI_BROUTE + 1)
 #endif
 
 struct nftnl_expr_meta {
@@ -168,6 +168,7 @@ static const char *meta_key2str_array[NFT_META_MAX] = {
 	[NFT_META_TIME_HOUR]	= "hour",
 	[NFT_META_SDIF]		= "sdif",
 	[NFT_META_SDIFNAME]	= "sdifname",
+	[NFT_META_BRI_BROUTE]	= "broute",
 };
 
 static const char *meta_key2str(uint8_t key)
-- 
2.34.1




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

  Powered by Linux