From 0f31d8258e7ead5bd3944080e6cec7d4074149e7 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sun, 12 May 2019 20:52:43 +0200 Subject: src: use definitions in include/linux/netfilter/nf_tables.h Use NFT_LOGLEVEL_* definitions in UAPI. Make an internal definition of NFT_OSF_F_VERSION, this was originally defined in the UAPI header in the initial patch version, however, this is not available anymore. Add a bison rule to deal with the timeout case. Otherwise, compilation breaks. Fixes: d3869cae9d62 ("include: refresh nf_tables.h cached copy") Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 9aea6526..9e632c0d 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -2414,23 +2414,23 @@ log_arg : PREFIX string level_type : string { if (!strcmp("emerg", $1)) - $$ = LOG_EMERG; + $$ = NFT_LOGLEVEL_EMERG; else if (!strcmp("alert", $1)) - $$ = LOG_ALERT; + $$ = NFT_LOGLEVEL_ALERT; else if (!strcmp("crit", $1)) - $$ = LOG_CRIT; + $$ = NFT_LOGLEVEL_CRIT; else if (!strcmp("err", $1)) - $$ = LOG_ERR; + $$ = NFT_LOGLEVEL_ERR; else if (!strcmp("warn", $1)) - $$ = LOG_WARNING; + $$ = NFT_LOGLEVEL_WARNING; else if (!strcmp("notice", $1)) - $$ = LOG_NOTICE; + $$ = NFT_LOGLEVEL_NOTICE; else if (!strcmp("info", $1)) - $$ = LOG_INFO; + $$ = NFT_LOGLEVEL_INFO; else if (!strcmp("debug", $1)) - $$ = LOG_DEBUG; + $$ = NFT_LOGLEVEL_DEBUG; else if (!strcmp("audit", $1)) - $$ = LOGLEVEL_AUDIT; + $$ = NFT_LOGLEVEL_AUDIT; else { erec_queue(error(&@1, "invalid log level"), state->msgs); @@ -4101,7 +4101,6 @@ ct_key : L3PROTOCOL { $$ = NFT_CT_L3PROTOCOL; } | PROTO_DST { $$ = NFT_CT_PROTO_DST; } | LABEL { $$ = NFT_CT_LABELS; } | EVENT { $$ = NFT_CT_EVENTMASK; } - | TIMEOUT { $$ = NFT_CT_TIMEOUT; } | ct_key_dir_optional ; @@ -4150,16 +4149,18 @@ ct_stmt : CT ct_key SET stmt_expr $$->objref.type = NFT_OBJECT_CT_HELPER; $$->objref.expr = $4; break; - case NFT_CT_TIMEOUT: - $$ = objref_stmt_alloc(&@$); - $$->objref.type = NFT_OBJECT_CT_TIMEOUT; - $$->objref.expr = $4; - break; default: $$ = ct_stmt_alloc(&@$, $2, -1, $4); break; } } + | CT TIMEOUT SET stmt_expr + { + $$ = objref_stmt_alloc(&@$); + $$->objref.type = NFT_OBJECT_CT_TIMEOUT; + $$->objref.expr = $4; + + } | CT ct_dir ct_key_dir_optional SET stmt_expr { $$ = ct_stmt_alloc(&@$, $3, $2, $5); -- cgit v1.2.3