Re: [PATCH nft v3 2/2] json: drop warning on stderr for missing json() hook in stmt_print_json()

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

 



On Fri, 2023-11-03 at 17:59 +0100, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:
> > On Fri, Nov 03, 2023 at 05:25:14PM +0100, Thomas Haller wrote:
> > > diff --git a/src/statement.c b/src/statement.c
> > > index f5176e6d87f9..d52b01b9099a 100644
> > > --- a/src/statement.c
> > > +++ b/src/statement.c
> > > @@ -141,6 +141,7 @@ static const struct stmt_ops chain_stmt_ops =
> > > {
> > >  	.type		= STMT_CHAIN,
> > >  	.name		= "chain",
> > >  	.print		= chain_stmt_print,
> > > +	.json		= NULL, /* BUG: must be implemented! */
> > 
> > This is a bit starting the house from the roof.
> > 
> > Better fix this first, so this ugly patch does not need to be
> > applied.
> 
> Agreed, I would keep the fprintf and all the fallback print code.
> We can remove this AFTER expternal means (unit test f.e.) ensure all
> the
> stmt/expr_ops have the needed callbacks.
> 


ACK. Then let's drop these two patches.
I'll add the workaround to the tests instead.

Please don't replace the fprintf() with a BUG(), because that's harder
to workaround.


Thomas





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

  Powered by Linux