From 49f6e9a846c6c8325b95debe04d5ebc3c01246fb Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 1 Dec 2017 13:40:21 +0100 Subject: meta: add secpath support This can be used to check if a packet has a secpath attached to it, i.e. was subject to ipsec processing. Example: add rule inet raw prerouting meta secpath exists accept Signed-off-by: Florian Westphal --- src/meta.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/meta.c b/src/meta.c index 687de8cd..8c2eca27 100644 --- a/src/meta.c +++ b/src/meta.c @@ -428,6 +428,8 @@ static const struct meta_template meta_templates[] = { [NFT_META_PRANDOM] = META_TEMPLATE("random", &integer_type, 4 * BITS_PER_BYTE, BYTEORDER_BIG_ENDIAN), /* avoid conversion; doesn't have endianess */ + [NFT_META_SECPATH] = META_TEMPLATE("secpath", &boolean_type, + BITS_PER_BYTE, BYTEORDER_HOST_ENDIAN), }; static bool meta_key_is_qualified(enum nft_meta_keys key) @@ -439,6 +441,7 @@ static bool meta_key_is_qualified(enum nft_meta_keys key) case NFT_META_PROTOCOL: case NFT_META_PRIORITY: case NFT_META_PRANDOM: + case NFT_META_SECPATH: return true; default: return false; -- cgit v1.2.3