From 627be570eff8f05849614a257e6fa45c744f4dbd Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 10 Mar 2017 18:13:50 +0100 Subject: exthdr: Add support for exthdr specific flags This allows to have custom flags in exthdr expression, which is necessary for upcoming existence checks (of both IPv6 extension headers as well as TCP options). Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/netlink_delinearize.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/netlink_delinearize.c') diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c index 36e8fe3c..9ad1e2c6 100644 --- a/src/netlink_delinearize.c +++ b/src/netlink_delinearize.c @@ -498,9 +498,9 @@ static void netlink_parse_exthdr(struct netlink_parse_ctx *ctx, const struct location *loc, const struct nftnl_expr *nle) { + uint32_t offset, len, flags; enum nft_registers dreg; enum nft_exthdr_op op; - uint32_t offset, len; uint8_t type; struct expr *expr; @@ -508,9 +508,10 @@ static void netlink_parse_exthdr(struct netlink_parse_ctx *ctx, 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 = nftnl_expr_get_u32(nle, NFTNL_EXPR_EXTHDR_OP); + flags = nftnl_expr_get_u32(nle, NFTNL_EXPR_EXTHDR_FLAGS); expr = exthdr_expr_alloc(loc, NULL, 0); - exthdr_init_raw(expr, type, offset, len, op); + exthdr_init_raw(expr, type, offset, len, op, flags); dreg = netlink_parse_register(nle, NFTNL_EXPR_EXTHDR_DREG); netlink_set_register(ctx, dreg, expr); -- cgit v1.2.3