diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-03-18 21:31:29 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-03-19 10:21:37 +0100 |
commit | 4aba100e593f28105be300dc888935fad5dc822f (patch) | |
tree | 78adb1227d4acc656e8601ee4f61d856465b757a | |
parent | abfafcdaf5689526ff4b5db5ee617cc3cc5b3a55 (diff) |
rule: reset cache iff there is an existing cache
If genid is unset, then do not reset existing cache. In the kernel,
generation ID is assumed to be always != zero.
This patch fixes:
nft 'add table x; add chain x y;'
that allow us to send several commands in one single batch from the
command line.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | src/rule.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -165,7 +165,9 @@ replay: genid = netlink_genid_get(&ctx); if (genid && genid == cache->genid) return 0; - cache_release(cache); + if (cache->genid) + cache_release(cache); + ret = cache_init(&ctx, cmd); if (ret < 0) { cache_release(cache); |