From 45e5e4e92a2c882b22e95a807026611612d57729 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 2 Mar 2016 13:56:43 +0100 Subject: 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 Acked-by: Pablo Neira Ayuso --- include/exthdr.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/exthdr.h b/include/exthdr.h index 87c42857..d17841bc 100644 --- a/include/exthdr.h +++ b/include/exthdr.h @@ -23,6 +23,8 @@ extern struct expr *exthdr_expr_alloc(const struct location *loc, extern void exthdr_init_raw(struct expr *expr, uint8_t type, unsigned int offset, unsigned int len); +extern bool exthdr_find_template(struct expr *expr, const struct expr *mask, + unsigned int *shift); enum hbh_hdr_fields { HBHHDR_INVALID, -- cgit v1.2.3