summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2017-08-22 18:01:44 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2017-08-23 23:42:33 +0200
commitaf038fcf186496ba07fe1cf59263b6741a0988da (patch)
treea72b21a2d372ab7d8e14ada11eade07c9ff491ec /src/parser_bison.y
parent7c43dc46179a6f85406eb861e970cbb06bac05d2 (diff)
src: add include_paths to struct nft_ctx
Not convenient to keep this as static for the upcoming library, so let's move it where it belongs. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 18be53e8..0a56d12c 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -48,7 +48,7 @@ void parser_init(struct mnl_socket *nf_sock, struct nft_cache *cache,
state->ectx.nf_sock = nf_sock;
}
-static void yyerror(struct location *loc, void *scanner,
+static void yyerror(struct location *loc, struct nft_ctx *nft, void *scanner,
struct parser_state *state, const char *s)
{
erec_queue(error(loc, "%s", s), state->msgs);
@@ -109,6 +109,7 @@ static void location_update(struct location *loc, struct location *rhs, int n)
%name-prefix "nft_"
%debug
%pure-parser
+%parse-param { struct nft_ctx *nft }
%parse-param { void *scanner }
%parse-param { struct parser_state *state }
%lex-param { scanner }
@@ -709,7 +710,7 @@ opt_newline : NEWLINE
common_block : INCLUDE QUOTED_STRING stmt_seperator
{
- if (scanner_include_file(scanner, $2, &@$) < 0) {
+ if (scanner_include_file(nft, scanner, $2, &@$) < 0) {
xfree($2);
YYERROR;
}