path: root/include/exthdr.h
diff options
authorFlorian Westphal <>2016-03-02 13:56:43 +0100
committerFlorian Westphal <>2016-03-02 13:56:43 +0100
commit45e5e4e92a2c882b22e95a807026611612d57729 (patch)
tree7033161bdc8b1ccb910d830fc58af0b257604b28 /include/exthdr.h
parent3bfe9a0323df8e23fa5150b88282cc7b4a6379f0 (diff)
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 <>
Diffstat (limited to 'include/exthdr.h')
1 files changed, 2 insertions, 0 deletions
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 {