summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-05-12 20:52:43 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-05-12 20:54:19 +0200
commit0f31d8258e7ead5bd3944080e6cec7d4074149e7 (patch)
tree57247981c948e9073a9df656afeaeb4ed92b0179 /src/parser_bison.y
parent47ffae232aeaadca37293861d52a11f907d6b768 (diff)
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 <pablo@netfilter.org>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y31
1 files changed, 16 insertions, 15 deletions
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);