]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: netlink_linearize: handle sub-byte lengths
authorFlorian Westphal <fw@strlen.de>
Tue, 17 Sep 2013 12:29:29 +0000 (14:29 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 17 Sep 2015 22:06:01 +0000 (00:06 +0200)
commitc3f0501b41e653e980e60d14eb88ac9dfc3afc61
tree6fb7d14f5bca09229cf98bbf128f52f9fe01638d
parent61ae81a313023e0b790594491bc030c06a3c0eab
src: netlink_linearize: handle sub-byte lengths

Currently length is expr->len / BITS_PER_BYTE, i.e. expr->len
has to be a multiple of 8.

When core asks for e.g. '9 bits', we truncate this to 8.
Round up to 16 and inject a 9-bit mask to zero out the parts we're not
interested in.

This will also need change to the delinarization step to
remove the extra op when dumping rules from kernel.

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