From: Eric Leblond Date: Mon, 10 Jul 2017 22:32:53 +0000 (+0200) Subject: evaluate: fix build with clang X-Git-Tag: v0.8~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fdb267c521ea8717fcd5cd1ddf38fc5b0e9c725;p=thirdparty%2Fnftables.git 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 --- 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;