JSON output is corrupted if there is an empty table with flags
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nftables (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Description: Ubuntu 22.04.2 LTS
Release: 22.04
nftables/
Linux 5.15.0-70-generic #77-Ubuntu SMP Tue Mar 21 14:02:37 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
My ruleset in /etc/nftables.conf ends with:
# muffle anything that comes via iptables-nft
table ip filter { flags dormant ; }
table ip nat { flags dormant ; }
table ip mangle { flags dormant ; }
table ip raw { flags dormant ; }
table ip security { flags dormant ; }
table ip6 filter { flags dormant ; }
table ip6 nat { flags dormant ; }
table ip6 mangle { flags dormant ; }
table ip6 raw { flags dormant ; }
table ip6 security { flags dormant ; }
While any of these tables are empty, 'nft -j list ruleset' returns truncated output at flags of one of these tables:
..., {"table": {"family": "ip6", "name": "security", "handle": 114, "flags": <truncated here
rc is 0
Affects nftables 1.0.2 in Ubuntu 22.04 (also 1.0.6 in Debian testing), but works fine in nftables 0.9.3 in Ubuntu 20.04.