From 4892fceea2b59415c9714293689f3f0d07ac5057 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 16 Jun 2021 01:45:29 +0200 Subject: src: add queue expr and flags to queue_stmt_alloc Preparation patch to avoid too much $$ references in the parser. Signed-off-by: Florian Westphal --- src/netlink_delinearize.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/netlink_delinearize.c') diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c index 58daa4e0..58497809 100644 --- a/src/netlink_delinearize.c +++ b/src/netlink_delinearize.c @@ -1467,9 +1467,8 @@ static void netlink_parse_queue(struct netlink_parse_ctx *ctx, const struct location *loc, const struct nftnl_expr *nle) { + uint16_t num, total, flags; struct expr *expr, *high; - struct stmt *stmt; - uint16_t num, total; num = nftnl_expr_get_u16(nle, NFTNL_EXPR_QUEUE_NUM); total = nftnl_expr_get_u16(nle, NFTNL_EXPR_QUEUE_TOTAL); @@ -1483,11 +1482,8 @@ static void netlink_parse_queue(struct netlink_parse_ctx *ctx, expr = range_expr_alloc(loc, expr, high); } - stmt = queue_stmt_alloc(loc); - stmt->queue.queue = expr; - stmt->queue.flags = nftnl_expr_get_u16(nle, NFTNL_EXPR_QUEUE_FLAGS); - - ctx->stmt = stmt; + flags = nftnl_expr_get_u16(nle, NFTNL_EXPR_QUEUE_FLAGS); + ctx->stmt = queue_stmt_alloc(loc, expr, flags); } struct dynset_parse_ctx { -- cgit v1.2.3