From e277fa7d015bd3f5d5d20be2c5adc4723f1867b2 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Sun, 25 Feb 2018 19:46:04 +0100 Subject: src: make raw payloads work make syntax consistent between print and parse. No dependency handling -- once you use raw expression, you need to make sure the raw expression only sees the packets that you'd want it to see. based on an earlier patch from Laurent Fasnacht . Laurents patch added a different syntax: @,,,, data_type is useful to make nftables not err when asking for "@payload,32,32 192.168.0.1", this patch still requires manual convsersion to an integer type (hex or decimal notation). data_type should probably be added later by adding an explicit cast expression, independent of the raw payload syntax. Signed-off-by: Florian Westphal --- src/payload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/payload.c') diff --git a/src/payload.c b/src/payload.c index ef437b44..09665a0e 100644 --- a/src/payload.c +++ b/src/payload.c @@ -48,7 +48,7 @@ static void payload_expr_print(const struct expr *expr, struct output_ctx *octx) if (payload_is_known(expr)) nft_print(octx, "%s %s", desc->name, tmpl->token); else - nft_print(octx, "payload @%s,%u,%u", + nft_print(octx, "@%s,%u,%u", proto_base_tokens[expr->payload.base], expr->payload.offset, expr->len); } -- cgit v1.2.3