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.0.6.1~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9dc9b2a5c50cc73b05cb83a3128fd8037e0ffe80;p=thirdparty%2Fnftables.git evaluate: reject unsupported expressions in payload statement for bitfields commit de447e248cce3ca3fd7040c386ac798c35721415 upstream. 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 de5ada83..ae5b07ba 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -3202,7 +3202,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;