diff options
author | Eric Leblond <eric@regit.org> | 2017-07-11 00:32:53 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-07-17 17:20:34 +0200 |
commit | 0fdb267c521ea8717fcd5cd1ddf38fc5b0e9c725 (patch) | |
tree | adbb191eb1f13ceeacf586b501f316125a367102 /src/evaluate.c | |
parent | f1e32ed35429a9890697efabca63dd9c88b55c2e (diff) |
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 <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r-- | src/evaluate.c | 3 |
1 files changed, 1 insertions, 2 deletions
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; |