Re: [PATCH nft 4/5] src: expr: add expression etype

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

 



On Fri, Feb 08, 2019 at 05:02:22PM +0100, Florian Westphal wrote:
> Temporary kludge to remove all the expr->ops->type == ... patterns.
> Followup patch will remove expr->ops, and make expr_ops() lookup
> the correct expr_ops struct instead to reduce struct expr size.
> 
> Signed-off-by: Florian Westphal <fw@xxxxxxxxx>
> ---
>  include/expression.h      |  3 +-
>  src/datatype.c            |  2 +-
>  src/evaluate.c            | 72 +++++++++++++++++++-------------------
>  src/expression.c          | 25 +++++++-------
>  src/exthdr.c              |  2 +-
>  src/json.c                |  2 +-
>  src/mergesort.c           |  2 +-
>  src/monitor.c             |  2 +-
>  src/netlink.c             | 10 +++---
>  src/netlink_delinearize.c | 73 +++++++++++++++++++--------------------
>  src/netlink_linearize.c   | 26 +++++++-------
>  src/parser_bison.y        | 10 +++---
>  src/parser_json.c         | 12 +++----
>  src/payload.c             | 10 +++---
>  src/rule.c                |  6 ++--
>  src/segtree.c             | 18 +++++-----
>  src/statement.c           |  8 ++---
>  src/tcpopt.c              |  2 +-
>  18 files changed, 143 insertions(+), 142 deletions(-)
> 
> diff --git a/include/expression.h b/include/expression.h
> index 8a4cf5b10b8c..2450bc90ec99 100644
> --- a/include/expression.h
> +++ b/include/expression.h
> @@ -220,6 +220,7 @@ struct expr {
>  
>  	const struct datatype	*dtype;
>  	enum byteorder		byteorder;
> +	enum expr_types		etype:8;

Probably use just type:8; ?

        expr->etype

sounds a bit redundant, but not a deal breaker :-)



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

  Powered by Linux