From bd82e03e15df882497eee46e4ba5db1442d88248 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 15 May 2018 11:37:56 +0200 Subject: 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 --- include/nftables.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/nftables.h') 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 { -- cgit v1.2.3