Re: [PATCH nft v4 3/4] src: Add support for concatenated set ranges

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

 



On Fri, 7 Feb 2020 12:18:11 +0100
Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:

> On Thu, Jan 30, 2020 at 01:16:57AM +0100, Stefano Brivio wrote:
> > diff --git a/src/evaluate.c b/src/evaluate.c
> > index 55591f5f3526..208250715e1f 100644
> > --- a/src/evaluate.c
> > +++ b/src/evaluate.c
> > @@ -136,6 +136,11 @@ static int byteorder_conversion(struct eval_ctx *ctx, struct expr **expr,
> >  
> >  	if ((*expr)->byteorder == byteorder)
> >  		return 0;
> > +
> > +	/* Conversion for EXPR_CONCAT is handled for single composing ranges */
> > +	if ((*expr)->etype == EXPR_CONCAT)
> > +		return 0;  
> 
> Are you also sure this is correct?

Yes, I think so: if we add a set with a concatenation of three
elements, byteorder_conversion() will be called three times with
(*expr)->etype == EXPR_VALUE (which is what we might actually need to
convert), and then once with EXPR_CONCAT, for which we have nothing to
do.

> This code was probably not exercised before with non-range
> concatenations.

I've seen it called for ranges in general. Do you mean we'd never get
past:

	if ((*expr)->byteorder == byteorder)
		return 0;

?

-- 
Stefano




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux