Its possible that we cannot find the template without also considering an implicit mask. For this we need to store the offset. Signed-off-by: Florian Westphal <fw@xxxxxxxxx> --- include/expression.h | 1 + src/exthdr.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/expression.h b/include/expression.h index eacbb2d..72b6f69 100644 --- a/include/expression.h +++ b/include/expression.h @@ -264,6 +264,7 @@ struct expr { /* EXPR_EXTHDR */ const struct exthdr_desc *desc; const struct proto_hdr_template *tmpl; + unsigned int offset; } exthdr; struct { /* EXPR_META */ diff --git a/src/exthdr.c b/src/exthdr.c index 9ed0b6a..512de0a 100644 --- a/src/exthdr.c +++ b/src/exthdr.c @@ -37,6 +37,7 @@ static void exthdr_expr_clone(struct expr *new, const struct expr *expr) { new->exthdr.desc = expr->exthdr.desc; new->exthdr.tmpl = expr->exthdr.tmpl; + new->exthdr.offset = expr->exthdr.offset; } static const struct expr_ops exthdr_expr_ops = { @@ -86,6 +87,7 @@ void exthdr_init_raw(struct expr *expr, uint8_t type, assert(expr->ops->type == EXPR_EXTHDR); expr->len = len; + expr->exthdr.offset = offset; expr->exthdr.desc = exthdr_protocols[type]; assert(expr->exthdr.desc != NULL); -- 2.4.10 -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html