From 0fdb267c521ea8717fcd5cd1ddf38fc5b0e9c725 Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Tue, 11 Jul 2017 00:32:53 +0200 Subject: evaluate: fix build with clang Building with a recent clang was failing due to the following error: src/evaluate.c|450 col 45| error: initializer element is not constant || static const unsigned int max_tcpoptlen = 15 * 4 * BITS_PER_BYTE - tcphdrlen; || ^~ Signed-off-by: Eric Leblond Signed-off-by: Pablo Neira Ayuso --- src/evaluate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/evaluate.c b/src/evaluate.c index 74a40974..db18df05 100644 --- a/src/evaluate.c +++ b/src/evaluate.c @@ -446,8 +446,7 @@ static int __expr_evaluate_exthdr(struct eval_ctx *ctx, struct expr **exprp) switch (expr->exthdr.op) { case NFT_EXTHDR_OP_TCPOPT: { - static const uint8_t tcphdrlen = 20 * BITS_PER_BYTE; - static const unsigned int max_tcpoptlen = 15 * 4 * BITS_PER_BYTE - tcphdrlen; + static const unsigned int max_tcpoptlen = (15 * 4 - 20) * BITS_PER_BYTE; unsigned int totlen = 0; totlen += expr->exthdr.tmpl->offset; -- cgit v1.2.3