]> git.ipfire.org Git - thirdparty/nftables.git/commit
segtree: Fix add and delete of element in same batch
authorPhil Sutter <phil@nwl.cc>
Thu, 21 Nov 2019 10:41:24 +0000 (11:41 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 2 Dec 2019 18:25:22 +0000 (19:25 +0100)
commitdd44081d91ceaead0a9730f1ab5c8041a4d905e2
treed813dff15e184d52444e192c27195e6d129292ef
parent7e326d697ecf43ea029de5584e59701eb61ca87e
segtree: Fix add and delete of element in same batch

The commit this fixes accidentally broke a rather exotic use-case which
is but used in set-simple.t of tests/monitor:

| # nft 'add element t s { 22-25 }; delete element t s { 22-25 }'

Since ranges are now checked for existence in userspace before delete
command is submitted to kernel, the second command above was rejected
because the range in question wasn't present in cache yet. Fix this by
adding new interval set elements to cache after creating the batch job
for them.

Fixes: decc12ec2dc31 ("segtree: Check ranges when deleting elements")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/rule.c