]> git.ipfire.org Git - thirdparty/nftables.git/commit
echo: Fix for added delays in rule updates
authorPhil Sutter <phil@nwl.cc>
Tue, 15 Aug 2017 11:59:12 +0000 (13:59 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 15 Aug 2017 12:03:36 +0000 (14:03 +0200)
commit2caecefe812e4d614687926d259ade3106935c56
tree7f4ba44760c607f2936d758b97771ed4f8501552
parentb2506e5504fed23ca9229ea398cab8998aa03712
echo: Fix for added delays in rule updates

The added cache update upon every command dealing with rules was a
bummer. Instead, perform the needed cache update only if echo option was
set.

Initially, I tried to perform the cache update from within
netlink_echo_callback(), but that turned into a mess since the shared
socket between cache_init() and mnl_batch_talk() would receive
unexpected new input. So instead update the cache from do_command_add(),
netlink_replace_rule_batch() and do_comand_insert() so it completes
before mnl_batch_talk() starts listening.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c
src/netlink.c
src/rule.c