diff options
author | Phil Sutter <phil@nwl.cc> | 2018-05-15 11:37:56 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-05-15 12:16:42 +0200 |
commit | bd82e03e15df882497eee46e4ba5db1442d88248 (patch) | |
tree | 3467189ed58eaa4b2c809ea28f9f94b4bceebbba /include | |
parent | fbc0768cb69686d00035456f1e9e0613927b1d4f (diff) |
libnftables: Move scanner object into struct nft_ctx
The initial approach of keeping as much of lex/yacc-specific data
local to the relevant parsing routines was flawed in that input
descriptors which parsed commands' location information points at were
freed after parsing (in scanner_destroy()) although they were required
later for error reporting in case a command was rejected by the kernel.
To overcome this, keep the scanner pointer in struct nft_ctx so that it
can be kept in place until kernel communication has finished.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/nftables.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/nftables.h b/include/nftables.h index f88d0530..5e209b41 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -52,6 +52,7 @@ struct nft_ctx { struct nft_cache cache; uint32_t flags; struct parser_state *state; + void *scanner; }; enum nftables_exit_codes { |