diff options
author | Manuel Messner <mm@skelett.io> | 2017-02-07 03:14:10 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2017-02-12 15:34:47 +0100 |
commit | a0cecb3ea474ad24adefcc388267684f2fddd69d (patch) | |
tree | 1b02005826ff852c638fc29f1ee32d12eaeaa3e2 /src/netlink_linearize.c | |
parent | 92632e23d96f56083fe77972be7fc5ee05a69d50 (diff) |
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 <mm@skelett.io>
Reviewed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src/netlink_linearize.c')
-rw-r--r-- | src/netlink_linearize.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |