]> git.ipfire.org Git - thirdparty/nftables.git/commit
evaluate: Fix debug output
authorPhil Sutter <phil@nwl.cc>
Wed, 4 Oct 2017 13:59:32 +0000 (15:59 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 6 Oct 2017 12:30:56 +0000 (14:30 +0200)
commit881fad86fa4942571c74cdfa89831a2cd25dbe16
tree8ddd4a0fde3e6306ad63884c691f02641b1dd255
parentb873a1731d2481851c57eab3dcf3e719e9d45b50
evaluate: Fix debug output

When introducing output_fp, debug output in src/evaluate.c was not
adjusted and therefore broke.

This patch restores eval debug output by applying the following changes:

- Change erec_print() and erec_print_list() to take a struct output_ctx
  pointer as first argument and use output_fp field as destination to
  print to.
- Drop octx_debug_dummy variable and instead use octx pointer from
  struct eval_ctx for debug output.
- Add missing calls to erec_destroy() in eval debug output which should
  eliminate another mem leak.

Fixes: 2535ba7006f22 ("src: get rid of printf")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/erec.h
src/cli.c
src/erec.c
src/evaluate.c
src/main.c