diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-06-05 11:56:11 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-06-05 17:54:21 +0200 |
commit | 60e917fa7cb55b4f675110bae78df56cd49bd486 (patch) | |
tree | e54c4b49146ce50f035a04e5f985fb2c690a9c08 /include | |
parent | 5db92ace9263ea1daa1d10c6f3a04ecc97317258 (diff) |
src: dynamic input_descriptor allocation
This patch introduces the input descriptor list, that stores the
existing input descriptor objects. These objects are now dynamically
allocated and release from scanner_destroy() path.
Follow up patches that decouple the parsing and the evaluation phases
require this for error reporting as described by b14572f72aac ("erec:
Fix input descriptors for included files"), this patch partially reverts
such partial.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/nftables.h | 1 | ||||
-rw-r--r-- | include/parser.h | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/include/nftables.h b/include/nftables.h index bb9bb209..af2c1ea1 100644 --- a/include/nftables.h +++ b/include/nftables.h @@ -165,6 +165,7 @@ enum input_descriptor_types { * @line_offset: offset of the current line to the beginning */ struct input_descriptor { + struct list_head list; struct location location; enum input_descriptor_types type; const char *name; diff --git a/include/parser.h b/include/parser.h index 8e57899e..a5ae802b 100644 --- a/include/parser.h +++ b/include/parser.h @@ -15,8 +15,9 @@ struct parser_state { struct input_descriptor *indesc; - struct input_descriptor indescs[MAX_INCLUDE_DEPTH]; + struct input_descriptor *indescs[MAX_INCLUDE_DEPTH]; unsigned int indesc_idx; + struct list_head indesc_list; struct list_head *msgs; unsigned int nerrs; |