]> git.ipfire.org Git - thirdparty/nftables.git/commit
libnftables: Keep cmds list outside of parser_state
authorPhil Sutter <phil@nwl.cc>
Fri, 13 Apr 2018 14:52:34 +0000 (16:52 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 14 Apr 2018 11:53:02 +0000 (13:53 +0200)
commit778de37d82e7bc90b4ba2abdfb0ebc8ddb2e7302
tree6dd8a979e615db7fb9c4f165b0011e5ec2a6efc1
parentfd9b62f6fdace59be247008b67506abb82bbf4a8
libnftables: Keep cmds list outside of parser_state

Parser basically turns input into a list of commands and error messages.
Having the commands list being part of struct parser_state does not make
sense from this point of view, also it will have to go away with
upcoming JSON support anyway.

While being at it, change nft_netlink() to take just the list of
commands instead of the whole parser state as parameter, also take care
of command freeing in nft_run_cmd_from_* functions (where the list
resides as auto-variable) instead of from inside nft_run().

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/parser.h
src/libnftables.c
src/parser_bison.y