path: root/include/nftables.h
diff options
authorPhil Sutter <>2018-05-15 11:37:56 +0200
committerPablo Neira Ayuso <>2018-05-15 12:16:42 +0200
commitbd82e03e15df882497eee46e4ba5db1442d88248 (patch)
tree3467189ed58eaa4b2c809ea28f9f94b4bceebbba /include/nftables.h
parentfbc0768cb69686d00035456f1e9e0613927b1d4f (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 <> Signed-off-by: Pablo Neira Ayuso <>
Diffstat (limited to 'include/nftables.h')
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 {