summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/parser_bison.y3
-rw-r--r--src/scanner.l10
2 files changed, 8 insertions, 5 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 0f4d51ad..2a8ac215 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -866,6 +866,7 @@ close_scope_ipsec : { scanner_pop_start_cond(nft->scanner, PARSER_SC_EXPR_IPSEC)
close_scope_numgen : { scanner_pop_start_cond(nft->scanner, PARSER_SC_EXPR_NUMGEN); };
close_scope_queue : { scanner_pop_start_cond(nft->scanner, PARSER_SC_EXPR_QUEUE); };
close_scope_rt : { scanner_pop_start_cond(nft->scanner, PARSER_SC_EXPR_RT); };
+close_scope_socket : { scanner_pop_start_cond(nft->scanner, PARSER_SC_EXPR_SOCKET); }
common_block : INCLUDE QUOTED_STRING stmt_separator
{
@@ -4798,7 +4799,7 @@ meta_stmt : META meta_key SET stmt_expr
}
;
-socket_expr : SOCKET socket_key
+socket_expr : SOCKET socket_key close_scope_socket
{
$$ = socket_expr_alloc(&@$, $2);
}
diff --git a/src/scanner.l b/src/scanner.l
index faf180ca..6a909e92 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -201,6 +201,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
%s SCANSTATE_EXPR_NUMGEN
%s SCANSTATE_EXPR_QUEUE
%s SCANSTATE_EXPR_RT
+%s SCANSTATE_EXPR_SOCKET
%%
@@ -274,10 +275,11 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr})
"ruleset" { return RULESET; }
"trace" { return TRACE; }
-"socket" { return SOCKET; }
-"transparent" { return TRANSPARENT; }
-"wildcard" { return WILDCARD; }
-
+"socket" { scanner_push_start_cond(yyscanner, SCANSTATE_EXPR_SOCKET); return SOCKET; }
+<SCANSTATE_EXPR_SOCKET>{
+ "transparent" { return TRANSPARENT; }
+ "wildcard" { return WILDCARD; }
+}
"tproxy" { return TPROXY; }
"accept" { return ACCEPT; }