summaryrefslogtreecommitdiffstats
path: root/tests/files
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-03-28 13:46:10 +0200
committerPhil Sutter <phil@nwl.cc>2023-03-29 17:41:06 +0200
commitce3d71348ee77d2d7ffa6a825afbc7471e92bc89 (patch)
treee377460c077269af36faf4c218617f9bdba18a97 /tests/files
parentcab08c47e687104c3774e196240f3da1ad2834e7 (diff)
xt: Fix translation error path
If xtables support was compiled in but the required libxtables DSO is not found, nft prints an error message and leaks memory: | counter packets 0 bytes 0 XT target MASQUERADE not found This is not as bad as it seems, the output combines stdout and stderr. Dropping stderr produces an incomplete ruleset listing, though. While this seemingly inline output can't easily be avoided, fix a few things: * Respect octx->error_fp, libnftables might have been configured to redirect stderr somewhere else. * Align error message formatting with others. * Don't return immediately, but free allocated memory and fall back to printing the expression in "untranslated" form. Fixes: 5c30feeee5cfe ("xt: Delay libxtables access until translation") Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'tests/files')
0 files changed, 0 insertions, 0 deletions