summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2022-08-23 12:51:52 +0200
committerFlorian Westphal <fw@strlen.de>2022-08-30 16:38:21 +0200
commit7284e79fcafe76ada4c73761bde125e836a5e3fa (patch)
tree0e15430a23c66aa6f480ae8c76daa887fdc47424
parent5472143922531e0f7ea2770b302903f5002472df (diff)
expr: update EXPR_MAX and add missing comments
WHen flagcmp and catchall expressions got added the EXPR_MAX definition wasn't changed. Should have no impact in practice however, this value is only checked to prevent crash when old nft release is used to list a ruleset generated by a newer nft release and a unknown 'typeof' expression. v2: Pablo suggested to add EXPR_MAX into enum so its easier to spot. Adding __EXPR_MAX + define EXPR_MAX (__EXPR_MAX - 1) causes '__EXPR_MAX not handled in switch' warnings, hence the 'EXPR_MAX =' solution. Signed-off-by: Florian Westphal <fw@strlen.de>
-rw-r--r--include/expression.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/expression.h b/include/expression.h
index cf7319b6..3f06a38a 100644
--- a/include/expression.h
+++ b/include/expression.h
@@ -41,6 +41,10 @@
* @EXPR_NUMGEN: number generation expression
* @EXPR_HASH: hash expression
* @EXPR_RT: routing expression
+ * @EXPR_FIB forward information base expression
+ * @EXPR_XFRM XFRM (ipsec) expression
+ * @EXPR_SET_ELEM_CATCHALL catchall element expression
+ * @EXPR_FLAGCMP flagcmp expression
*/
enum expr_types {
EXPR_INVALID,
@@ -73,8 +77,9 @@ enum expr_types {
EXPR_XFRM,
EXPR_SET_ELEM_CATCHALL,
EXPR_FLAGCMP,
+
+ EXPR_MAX = EXPR_FLAGCMP
};
-#define EXPR_MAX EXPR_XFRM
enum ops {
OP_INVALID,