]> git.ipfire.org Git - thirdparty/ulogd2.git/commit
ipfix: re-arm send timer
authorCorubba Smith <corubba@gmx.de>
Sun, 16 Feb 2025 14:05:01 +0000 (15:05 +0100)
committerFlorian Westphal <fw@strlen.de>
Tue, 11 Mar 2025 15:36:16 +0000 (16:36 +0100)
commite318d352b1085ec55b998c501d67d758dfa74a1f
tree55ee436b9621a3a3fc17d8fd6f1378365f445a56
parentbebb752ce4d4d9d6bfedeb595fef8fdee42dd98a
ipfix: re-arm send timer

I am not sure what this timer was meant to do. My best guess is to send
an ipfix message every second if there is data, as to make sure reports
go out in a timely manner. Otherwise a message is only sent when adding
another flow would go past the max mtu, which may take a while if there
isn't much (filtered) traffic.

Timers in ulogd only fire once; if they should fire repeatedly (which I
guess was the intention here), they need to be re-armed in the callback.
Because that wasn't done, the timer only fired once 1 second after
starting the plugin (when there is unlikely any data yet), and then
never again.

The timer is now re-armed in the callback to make it fire repeatedly
every second(ish). A macro is used to make sure the initial and re-arm
time interval is the same.

Fixes: 4f639231c83b ("IPFIX: Add IPFIX output plugin")
Signed-off-by: Corubba Smith <corubba@gmx.de>
Signed-off-by: Florian Westphal <fw@strlen.de>
output/ipfix/ulogd_output_IPFIX.c