From a0cecb3ea474ad24adefcc388267684f2fddd69d Mon Sep 17 00:00:00 2001 From: Manuel Messner Date: Tue, 7 Feb 2017 03:14:10 +0100 Subject: exthdr: prepare for tcp support right now exthdr only deals with ipv6 extension headers, followup patch will enable tcp option matching. This adds the 'op' arg to exthdr_init. Signed-off-by: Manuel Messner Reviewed-by: Florian Westphal Signed-off-by: Florian Westphal --- src/netlink_linearize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/netlink_linearize.c') diff --git a/src/netlink_linearize.c b/src/netlink_linearize.c index 5030135c..056f1131 100644 --- a/src/netlink_linearize.c +++ b/src/netlink_linearize.c @@ -162,14 +162,14 @@ static void netlink_gen_exthdr(struct netlink_linearize_ctx *ctx, const struct expr *expr, enum nft_registers dreg) { + unsigned int offset = expr->exthdr.tmpl->offset; struct nftnl_expr *nle; nle = alloc_nft_expr("exthdr"); netlink_put_register(nle, NFTNL_EXPR_EXTHDR_DREG, dreg); nftnl_expr_set_u8(nle, NFTNL_EXPR_EXTHDR_TYPE, expr->exthdr.desc->type); - nftnl_expr_set_u32(nle, NFTNL_EXPR_EXTHDR_OFFSET, - expr->exthdr.tmpl->offset / BITS_PER_BYTE); + nftnl_expr_set_u32(nle, NFTNL_EXPR_EXTHDR_OFFSET, offset / BITS_PER_BYTE); nftnl_expr_set_u32(nle, NFTNL_EXPR_EXTHDR_LEN, div_round_up(expr->len, BITS_PER_BYTE)); nftnl_rule_add_expr(ctx->nlr, nle); -- cgit v1.2.3