]> git.ipfire.org Git - thirdparty/nftables.git/commit
evaluate: string prefix expression must retain original length
authorFlorian Westphal <fw@strlen.de>
Sat, 9 Apr 2022 13:58:27 +0000 (15:58 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 13 Apr 2022 11:43:33 +0000 (13:43 +0200)
commit403936c1ffa34bc597d7ee0792154fc6c6b483f2
tree4e2f72fb80b432533715c4e94f0c35a71e7a2d6a
parentada50f84bf5a1475549f3f372834812e7cd8d675
evaluate: string prefix expression must retain original length

To make something like "eth*" work for interval sets (match
eth0, eth1, and so on...) we must treat the string as a 128 bit
integer.

Without this, segtree will do the wrong thing when applying the prefix,
because we generate the prefix based on 'eth*' as input, with a length of 3.

The correct import needs to be done on "eth\0\0\0\0\0\0\0...", i.e., if
the input buffer were an ipv6 address, it should look like "eth\0::",
not "::eth".

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c