From dd05c561a02e2de3bf7bda8d51c8777cb7564ff1 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 20 Aug 2021 12:43:50 +0200 Subject: src: queue: consolidate queue statement syntax Print queue statement using the 'queue ... to' syntax to consolidate the syntax around Florian's proposal introduced in 6cf0f2c17bfb ("src: queue: allow use of arbitrary queue expressions"). Retain backward compatibility, 'queue num' syntax is still allowed. Update and add new tests. Signed-off-by: Pablo Neira Ayuso --- src/statement.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/statement.c') diff --git a/src/statement.c b/src/statement.c index 97b163e8..03c0acf6 100644 --- a/src/statement.c +++ b/src/statement.c @@ -507,15 +507,10 @@ static void queue_stmt_print(const struct stmt *stmt, struct output_ctx *octx) nft_print(octx, "%sfanout", delim); if (e) { - if (e->etype == EXPR_VALUE || e->etype == EXPR_RANGE) { - nft_print(octx, " num "); - expr_print(stmt->queue.queue, octx); - } else { - nft_print(octx, " to "); - expr_print(stmt->queue.queue, octx); - } + nft_print(octx, " to "); + expr_print(stmt->queue.queue, octx); } else { - nft_print(octx, " num 0"); + nft_print(octx, " to 0"); } } -- cgit v1.2.3