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_delinearize.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/netlink_delinearize.c') diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c index 48968442..f21d2d56 100644 --- a/src/netlink_delinearize.c +++ b/src/netlink_delinearize.c @@ -499,6 +499,7 @@ static void netlink_parse_exthdr(struct netlink_parse_ctx *ctx, const struct nftnl_expr *nle) { enum nft_registers dreg; + enum nft_exthdr_op op; uint32_t offset, len; uint8_t type; struct expr *expr; @@ -506,9 +507,10 @@ static void netlink_parse_exthdr(struct netlink_parse_ctx *ctx, type = nftnl_expr_get_u8(nle, NFTNL_EXPR_EXTHDR_TYPE); offset = nftnl_expr_get_u32(nle, NFTNL_EXPR_EXTHDR_OFFSET) * BITS_PER_BYTE; len = nftnl_expr_get_u32(nle, NFTNL_EXPR_EXTHDR_LEN) * BITS_PER_BYTE; + op = NFT_EXTHDR_OP_IPV6; expr = exthdr_expr_alloc(loc, NULL, 0); - exthdr_init_raw(expr, type, offset, len); + exthdr_init_raw(expr, type, offset, len, op); dreg = netlink_parse_register(nle, NFTNL_EXPR_EXTHDR_DREG); netlink_set_register(ctx, dreg, expr); -- cgit v1.2.3