Hi, On Tue, Aug 04, 2020 at 12:20:05PM +0200, Jose M. Guisado wrote: > On 3/8/20 14:52, Phil Sutter wrote: > > On Sat, Aug 01, 2020 at 09:27:30PM +0200, Pablo Neira Ayuso wrote: > >> We need an unified way to deal with --json --echo, whether the input > >> is native nft or json syntax. > > > > We don't need, but seems we want. We have JSON output and JSON echo for > > a while now and code for both is distinct. I fail to see why this was OK > > but is no longer. From my perspective, Jose simply failed to see that > > JSON output code should be used for JSON echo if input is not JSON. > > I will send a v4 for this patch honoring separate cases. > > Only outputting JSON command objects when input has been native instead > of JSON, for the latter the behavior is kept intact and no > json_cmd_assoc is touched. I think that's what we are looking for right > now. This shouldn't interfere with firewalld, right?. Sounds good. Unless I'm mistaken, all that's needed is to skip the call to json_events_cb() (including the return) in netlink_echo_callback() if input was not JSON, i.e. nft_ctx->json_root is NULL. Cheers, Phil