From: Florian Westphal Date: Tue, 23 Aug 2022 10:51:52 +0000 (+0200) Subject: expr: update EXPR_MAX and add missing comments X-Git-Tag: v1.0.6~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7284e79fcafe76ada4c73761bde125e836a5e3fa;p=thirdparty%2Fnftables.git 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 --- 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,