]> git.ipfire.org Git - thirdparty/nftables.git/commit
evaluate: fix get element for concatenated set
authorFlorian Westphal <fw@strlen.de>
Tue, 5 Sep 2023 14:32:16 +0000 (16:32 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 6 Sep 2023 09:26:19 +0000 (11:26 +0200)
commit988e83a1ce61a829473082221a790e72f8d43519
tree18694598ca4334b2d0f8905bfe26f98d17e615e6
parent05628cdd677d727f83fd9c576183b44d2452ddbb
evaluate: fix get element for concatenated set

given:
table ip filter {
set test {
type ipv4_addr . ether_addr . mark
flags interval
elements = { 198.51.100.0/25 . 00:0b:0c:ca:cc:10-c1:a0:c1:cc:10:00 . 0x0000006f, }
}
}

We get lookup failure:

nft get element ip filter test { 198.51.100.1 . 00:0b:0c:ca:cc:10 . 0x6f }
Error: Could not process rule: No such file or directory

Its possible to work around this via dummy range somewhere in the key, e.g.
nft get element ip filter test { 198.51.100.1 . 00:0b:0c:ca:cc:10 . 0x6f-0x6f }

but that shouldn't be needed, so make sure the INTERVAL flag is enabled
for the queried element if the set is of interval type.

Signed-off-by: Florian Westphal <fw@strlen.de>
src/evaluate.c