]> git.ipfire.org Git - thirdparty/iptables.git/commit
xtables: Implement per chain rule cache
authorPhil Sutter <phil@nwl.cc>
Thu, 20 Dec 2018 15:09:12 +0000 (16:09 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 27 Dec 2018 18:53:01 +0000 (19:53 +0100)
commit947c51c95edbbf08d6b3c105177ac5cfa238aade
treea25744e4e9d94ec92afb774b78f68259298da24b
parenteb13831f1c41c0efa626ab85d4448fb8ce4c87a2
xtables: Implement per chain rule cache

Use recently introduced support for rules inside chains in libnftnl to
introduce a rule cache per chain instead of a global one.

A tricky bit is to decide if cache should be updated or not. Previously,
the global rule cache was populated just once and then reused unless
being flushed completely (via call to flush_rule_cache() with
NULL-pointer table argument). Resemble this behaviour by introducing a
boolean indicating cache status and fetch rules for all chains when
updating the chain cache in nft_chain_list_get().

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/nft.c
iptables/nft.h