]> git.ipfire.org Git - thirdparty/nftables.git/commit
netlink_delinearize: handle extension header templates with odd sizes
authorFlorian Westphal <fw@strlen.de>
Wed, 2 Mar 2016 12:56:43 +0000 (13:56 +0100)
committerFlorian Westphal <fw@strlen.de>
Wed, 2 Mar 2016 12:56:43 +0000 (13:56 +0100)
commit45e5e4e92a2c882b22e95a807026611612d57729
tree7033161bdc8b1ccb910d830fc58af0b257604b28
parent3bfe9a0323df8e23fa5150b88282cc7b4a6379f0
netlink_delinearize: handle extension header templates with odd sizes

This enables nft to display
frag frag-off 33

... by considering a mask during binop postprocess in case
the initial template lookup done when the exthdr expression was
created did not yield a match.

In the above example, kernel netlink data specifies 16bits,
but the frag field is only 13bits wide.

We use the implicit binop mask to re-do the template lookup with
corrected offset and size information.

Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/exthdr.h
src/exthdr.c
src/netlink_delinearize.c