Re: [PATCH nft] src: deprecate "flow table" syntax, replace it by "meter"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23 November 2017 at 15:23, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:
> According to bugzilla 1137: "flow tables" should not be syntactically
> unique.
>
> "Flow tables are always named, but they don't conform to the way sets,
> maps, and dictionaries work in terms of "add" and "delete" and all that.
>
> They are also "flow tables" instead of one word like "flows" or
> "throttle" or something.
>
> It seems weird to just have these break the syntactic expectations."
>
> Personally, I never liked the reference to "table" since we have very
> specific semantics in terms of what a "table" is netfilter for long
> time.
>
> This patch promotes "meter" as the new keyword. The former syntax is
> still accepted for a while, just to reduce chances of breaking things.
> At some point the former syntax will just be removed.
>
> Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1137
> Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
>

I agree.

What about adding a warning in case of using the old syntax?
Something like:

WARNING: this syntax is deprecated and will be deleted in the future,
use 'meter' instead.

Acked-by: Arturo Borrero Gonzalez <arturo@xxxxxxxxxxxxx>

> diff --git a/src/evaluate.c b/src/evaluate.c
> index fd61e7530d2e..3d4824ff80d6 100644
> --- a/src/evaluate.c
> +++ b/src/evaluate.c
> @@ -2021,37 +2021,37 @@ static int stmt_evaluate_payload(struct eval_ctx *ctx, struct stmt *stmt)
>         return expr_evaluate(ctx, &stmt->payload.val);
>  }
>
> -static int stmt_evaluate_flow(struct eval_ctx *ctx, struct stmt *stmt)
> +static int stmt_evaluate_meter(struct eval_ctx *ctx, struct stmt *stmt)
>  {
>         struct expr *key, *set, *setref;
>
>         expr_set_context(&ctx->ectx, NULL, 0);
> -       if (expr_evaluate(ctx, &stmt->flow.key) < 0)
> +       if (expr_evaluate(ctx, &stmt->meter.key) < 0)
>                 return -1;
> -       if (expr_is_constant(stmt->flow.key))
> -               return expr_error(ctx->msgs, stmt->flow.key,
> +       if (expr_is_constant(stmt->meter.key))
> +               return expr_error(ctx->msgs, stmt->meter.key,
>                                   "Flow key expression can not be constant");

^
line below contains flow instead of meter

> -       if (stmt->flow.key->comment)
> -               return expr_error(ctx->msgs, stmt->flow.key,
> +       if (stmt->meter.key->comment)
> +               return expr_error(ctx->msgs, stmt->meter.key,
>                                   "Flow key expression can not contain comments");

^
same here
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux