]> git.ipfire.org Git - thirdparty/ulogd2.git/commit
nfct: add network namespace support
authorCorubba Smith <corubba@gmx.de>
Wed, 26 Mar 2025 23:07:49 +0000 (00:07 +0100)
committerFlorian Westphal <fw@strlen.de>
Tue, 20 May 2025 10:46:00 +0000 (12:46 +0200)
commitb794e7b89ab0324eceac8f3e16560cd5a50d63a8
tree1322f3da8ab69240c419e56c0917c62c505463c3
parentb039c9c9d2b8dcdd9accd1cba35a5119d48babf2
nfct: add network namespace support

Allow the plugin to fetch data from a different network namespace. This
is possible by changing the network namespace before opening the netlink
socket, and immediately changing back to the original network namespace
once the socket is open. The number of nfct_open usages here warranted a
dedicated wrapper function.

If changing back to the original network namespace fails, ulogd will
log an error, but continue to run in a different network namespace than
it was started in, which may cause unexpected behaviour. But I don't see
a way to properly "escalate" it such that ulogd aborts entirely.

Also slightly adjust the error log messages to specify which socket
failed to open.

Signed-off-by: Corubba Smith <corubba@gmx.de>
Signed-off-by: Florian Westphal <fw@strlen.de>
input/flow/ulogd_inpflow_NFCT.c
ulogd.conf.in