diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-08-22 18:45:52 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-08-23 23:42:33 +0200 |
commit | be441e1ffdc2495162399b61053a8f8c18ebc5b6 (patch) | |
tree | 6c49381c37635690f69c8d21f52c24648b53210f /src/parser_bison.y | |
parent | e1946ec7f11e2c6daa11b141eb344ef44642056f (diff) |
src: add debugging mask to context structure
So this toggle is not global anymore. Update name that fits better with
the semantics of this variable.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r-- | src/parser_bison.y | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y index c2fd67de..333c6432 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -36,7 +36,8 @@ #include "parser_bison.h" void parser_init(struct mnl_socket *nf_sock, struct nft_cache *cache, - struct parser_state *state, struct list_head *msgs) + struct parser_state *state, struct list_head *msgs, + unsigned int debug_mask) { memset(state, 0, sizeof(*state)); init_list_head(&state->cmds); @@ -46,6 +47,7 @@ void parser_init(struct mnl_socket *nf_sock, struct nft_cache *cache, state->ectx.cache = cache; state->ectx.msgs = msgs; state->ectx.nf_sock = nf_sock; + state->ectx.debug_mask = debug_mask; } static void yyerror(struct location *loc, struct nft_ctx *nft, void *scanner, @@ -118,9 +120,9 @@ static void location_update(struct location *loc, struct location *rhs, int n) %initial-action { location_init(scanner, state, &yylloc); - if (debug_level & DEBUG_SCANNER) + if (nft->debug_mask & DEBUG_SCANNER) nft_set_debug(1, scanner); - if (debug_level & DEBUG_PARSER) + if (nft->debug_mask & DEBUG_PARSER) yydebug = 1; } |