[Bug 1224] nft export json fails with successful return code

bugzilla-daemon at netfilter.org bugzilla-daemon at netfilter.org
Tue Feb 6 03:44:06 CET 2018


Shyam Saini <mayhs11saini at gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |phil at nwl.cc

--- Comment #1 from Shyam Saini <mayhs11saini at gmail.com> ---
Hi Anthony,

> I recently upgraded to nftables v0.8.2 and encountered a regression.
> "nft export json" no longer works, it returns a success code (0), but
> doens't print any JSON data.
> A git bisect determined this was introduced in commit
> 2fa54d8a49352bda44d3e25d1d7ba3531faf3303, and upon reading that commit, I
> noticed the introduction of "nft export vm json" which does work as expected.

Technically when we were exporting json by "nft export json" it was giving us 
low level virtual-machine(vm) pseudo code. So we renamed it as "vm json". 
As you have already mentioned that you are able achieve old behaviour by 
"nft export vm json", that is right behaviour.

Further, by this renaming it creates scope for high level json which
represents abstract syntax tree of nft grammar. This high level json
can be exported by "nft export json". 
But this feature is yet to come in mainline so we are doing "no operation" we
user executes "nft export json" and it returns 0.

> I believe "nft export json" should either export json like it did before
> this commit, or return a non-zero code if this is the intended functionality.

I hope above explanation clarifies this. 

I'm cc'ing Phil, he may put some light on high level json.

You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20180206/dcc88e97/attachment.html>

More information about the netfilter-buglog mailing list