From: Pablo Neira Ayuso Date: Fri, 28 Feb 2025 14:57:18 +0000 (+0100) Subject: evaluate: reject unsupported expressions in payload statement for bitfields X-Git-Tag: v1.1.2~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de447e248cce3ca3fd7040c386ac798c35721415;p=thirdparty%2Fnftables.git evaluate: reject unsupported expressions in payload statement for bitfields The payload statement evaluation pretends that it can handle any expression for bitfields, but the existing evaluation code only knows how to handle value expression. Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/evaluate.c b/src/evaluate.c index c090aebe..d7915ed1 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -3351,7 +3351,8 @@ static int stmt_evaluate_payload(struct eval_ctx *ctx, struct stmt *stmt) mpz_lshift_ui(stmt->payload.val->value, shift_imm); break; default: - break; + return expr_error(ctx->msgs, stmt->payload.val, + "payload statement for this expression is not supported"); } masklen = payload_byte_size * BITS_PER_BYTE;