]> git.ipfire.org Git - thirdparty/nftables.git/commit
src: move payload sub-byte matching to the evaluation step
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 10 May 2016 22:17:47 +0000 (00:17 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 11 May 2016 21:01:30 +0000 (23:01 +0200)
commitf0d0c7703c1b7eed847d1e830d8d66497f6fff62
tree8573af07a4e68ceeb8b7407e183dcc3d00d20c1f
parentb8b8e7b6ae10d6a0ab9f3778705f1b075e760859
src: move payload sub-byte matching to the evaluation step

Generating the bitwise logic to match sub-byte payload fields from the
linearize step has several problems:

1) When the bits are split between two bytes and the payload field is
   smaller than one byte, we need to extend the expression length on
   both sides (payload and constant) of the relational expression.

2) Explicit bitmask operations on sub-byte payload fields need to be
   merge to the implicit bitmask operation, otherwise we generate two
   bitwise instructions. This is not resolved by this patch, but we
   should have a look at some point to this.

With this approach, we can benefit from the binary operation transfer
for shifts to provide a generic way to adjust the constant side of the
expression.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/evaluate.c
src/netlink_linearize.c